#include<iostream>
using namespace std;
int main()
{
    int num;
    double sx1, sy1, sx2, sy2;
    double ex1, ey1, ex2, ey2;
 
    cin >> num;
 
    for(int i = 0; i < num; i++)
    {
        cin >> sx1 >> sy1 >> sx2 >> sy2 >> ex1 >> ey1 >> ex2 >> ey2;
 
        if( (sy2-sy1)/(sx2 - sx1) == (ey2-ey1)/(ex2-ex1))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
}