#include <stdio.h>

int main(){
	int num;
	float x1, y1;
	float x2, y2;
	float x3, y3;
	float x4, y4;
	float vxa;
	float vya;
	float vxb;
	float vyb;
	float s;
				
	while(scanf("%d", &num) != EOF){	
		for(int i = 0; i < num; i++){
			scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);

			vxa = x2 - x1;
			vya = y2 - y1;
			vxb = x4 - x3;
			vyb = y4 - y3;
			s = vxa*vyb - vxb*vya;
			if(-0.00001 < s && s < 0.00001){
				printf("YES\n");
			}else{
				printf("NO\n");
			}
		}
	}
	
	return 0;
}