#include<bits/stdc++.h>

#define EPS 1.0e-10

using namespace std;

bool is_parallel(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy){
    double cp = (bx-ax)*(dy-cy) - (by-ay)*(dx-cx);
    return fabs(cp) < EPS;
}

int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;++i){
        double x1, y1, x2, y2, x3, y3, x4, y4;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
        if(is_parallel(x1,y1,x2,y2,x3,y3,x4,y4))
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }

    return 0;
}
