#include<stdio.h>
#include <math.h>

int main(void)
{
	double x[4]={0},y[4]={0},x1,x2,y1,y2;
	int i;
	scanf("%d",&i);

	while(i!=0)
	{
		scanf("%f %f %f %f %f %f %f %f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]);
		if(fabs(x[0])>100 ||fabs(y[0])>100 ||fabs(x[1])>100 ||fabs(y[1])>100 ||
			fabs(x[2])>100 ||fabs(y[2])>100||fabs(x[3])>100||fabs(y[3])>100)break;
		x1 = x[1]-x[0];   y1 = y[1]-y[0];
		x2 = x[3]-x[2];   y2 = y[3]-y[2];
		if(x1==0 && x2==0)
			printf("YES\n");
		else if(x1==0  || x2==0)
			printf("NO\n");
		else if((y1/x1) == (y2/x2))
			printf("YES\n");
		else 
			printf("NO\n");

		i-=1;
	}
 return 0;
}