#include <stdio.h>

int
main(void)
{
	char line[256];
	int n;

	fgets(line, sizeof line, stdin);
	sscanf(line, "%d", &n);

	double x1, y1, x2, y2, x3, y3, x4, y4;
	
	while (n--) {
		fgets(line, sizeof line, stdin);
		sscanf(line, "%lf %lf %lf %lf %lf %lf %lf %lf",
				   &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);

		double ab = (y2 - y1)/(x2 - x1);
		double cd = (y4 - y3)/(x4 - x3);
		
		printf("%s\n", ((ab == cd) ? "YES" : "NO"));
	}

	return 0;
}