#include <iostream>

using namespace std;

int main() {
	double x[4], y[4];
	double ab, cd;
	int n;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
		if (x[0] < x[1]) {
			swap(x[0], x[1]);
			swap(y[0], y[1]);
		}
		if (x[2] < x[3]) {
			swap(x[2], x[3]);
			swap(y[2], y[3]);
		}
		ab = cd = 999999;
		if (x[0] != x[1])
			ab = (y[0] - y[1]) / (x[0] - x[1]);
		if (x[2] != x[3])
			cd = (y[2] - y[3]) / (x[2] - x[3]);
		if (ab == cd)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}