#include<iostream>
#include<complex>
using namespace std;
typedef complex<long long> xy_t;

xy_t P[4];

long long cross(xy_t p,xy_t q){
    return (conj(p)*q).imag();
}

int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;++i){
        for(int j=0;j<4;++j){
            double x,y;
            cin>>x>>y;
            P[j]=xy_t(100000*x,100000*y);
        }
        
        xy_t a[2]={
            P[0]-P[1],
            P[2]-P[3]
        };

        bool flag=abs(cross(a[0],a[1]));

        cout<<(flag?"NO":"YES")<<"\n";

    }
}