#include <iostream>
using namespace std;

int main() {
	double x[4], y[4];
	double dx[2], dy[2];
	int n;

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

		if (dx[0] * dy[1] == dx[1] * dy[0]) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}

	return 0;
}