#include <cstdio>
#include <iostream>

using namespace std;

int main( ) {
	int i, n;
	double x[4][100], y[4][100];
	double slope1[100], slope2[100];

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		for (int j = 0; j < 4; j++) {
			scanf("%lf %lf", &x[j][i], &y[j][i]);
			slope1[i] = (y[1][i] - y[0][i]) / (x[1][i] - x[0][i]);
			slope2[i] = (y[3][i] - y[2][i]) / (x[3][i] - x[2][i]);
		}
	}

	for (i = 0; i < n; i++) {
		if (slope1[i] == slope2[i]) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	
	return 0;
}