#include <cstdio>

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		float x1, y1, x2, y2, x3, y3, x4, y4;
		scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
		
		float res1 = 1.0f, res2 = 2.0f;
		bool flg1 = false, flg2 = false;
		
		if (x2 > x1) res1 = (y2-y1)/(x2-x1);
		else if (x2 == x1) flg1 = true;
		else res1 = (y1-y2)/(x1-x2);
		if (res1 == 0.0f) flg1 = true;
		
		if (x4 > x3) res2 = (y4-y3)/(x4-x3);
		else if (x4 == x3) flg2 = true;
		else res2 = (y3-y4)/(x3-x4);
		if (res2 == 0.0f) flg2 = true;
		
		if (res1 == res2) {
			puts("YES");
		}
		else {
			if (flg1 && flg2) puts("YES");
			else puts("NO");
		}
	}
	return 0;
}