#include<stdio.h>

int main(void){
	int n,i;
	float ax,ay,bx,by,cx,cy,dx,dy;
	float datax_1,datax_2,datay_1,datay_2;

	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%f %f %f %f %f %f %f %f",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy);
		datax_1=bx-ax;
		datax_2=dx-cx;
		datay_1=by-ay;
		datay_2=dy-cy;
		if(datax_1==datax_2 && datay_1==datay_2)
			printf("YES\n");
		else
			printf("No\n");
	}

	return 0;
}