#include<iostream>
#include<vector>
using namespace std;
struct c {
	double x;
	double y;
};
int main() {
	int d;
	cin >> d;
	vector<bool>qq;
	for (int j = 0; j < d; j++) {
		const int num = 4;
		c l[num];
		for (int i = 0; i < num; i++) {
			cin >> l[i].x >> l[i].y;
		}
		if ((l[0].x - l[1].x) / (l[0].y - l[1].y) == (l[2].x - l[3].x) / (l[2].y - l[3].y))
			qq.push_back(true);

		else
			qq.push_back(false);
	}
	for (int i = 0; i < d; i++){
		if (qq[i] == true)cout << "YES";
		else cout << "NO";
		cout << endl;
	}
	char c; 
	cin >> c;
}