#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	cin >> n;

	for (int i = 0; i < n; i++) {
		double x[4], y[4];
		for (int j = 0; j < 4; j++){
			cin >> x[j] >> y[j];
		}

		double abx = x[0] - x[1], cdx = x[2] - x[3];
		double aby = y[0] - y[1], cdy = y[2] - y[3];

		if (aby / abx == cdy / cdx){
		   cout << "YES" << endl;
		}

		else {
			cout << "NO" << endl;
		}
	}
	return (0);
}