#include<iostream>
#include<cmath>
using namespace std;

typedef double dbl;
dbl x[4], y[4];

bool parallelism() {
	if (x[0] == x[1]) {
		if (x[2] == x[3]) return true;
		else return false;
	}
	else {
		if (x[2] == x[3]) return false;
		else {
			dbl k12 = (y[1] - y[0]) / (x[1] - x[0]);
			dbl k34 = (y[3] - y[2]) / (x[3] - x[2]);
			if (fabs(k12 - k34) < 1e-10) return true;
			else return false;
		}
	}
}
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 4; j++) {
			cin >> x[j] >> y[j];
		}
		if (parallelism()) cout << "YES\n";
		else cout << "NO\n";
	}
}
