#include<stdio.h>

int main(){

int N;
double x1,x2,x3,x4,y1,y2,y3,y4;
double a1=0,a2=0;

scanf("%d",&N);
for(int i=0;i<N;i++)
{
scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
a1=(x1-x2)*(y3-y4);a2=(x3-x4)*(y1-y2);
if(a1==a2)printf("YES\n");
else if(a1!=a2)printf("NO\n");
}
return 0;
}