#include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
double c[8];
for(int b=0;b<a;b++){
    for(int d=0;d<8;d++)cin>>c[d];
    if(c[0]==c[2]&&c[4]==c[6])printf("YES\n");
    else if((c[1]-c[3])/(c[0]-c[2])==(c[5]-c[7])/(c[4]-c[6]))printf("YES\n");
    else printf("NO\n");
    }
}