#include<iostream>
using namespace std;
int main() {
	double zhyoxy[4], line1, line2;
	char hantei[2];
	int time;
	cin >> time;
	for (int i = 0; i < time; ++i) {
		for (int i = 0; i < 4; ++i) {
			cin >> zhyoxy[i];
		}
		if (zhyoxy[3] == zhyoxy[1]) {
			hantei[0] = 'y';
		}
		else if (zhyoxy[2] == zhyoxy[0]) {
			hantei[0] = 'x';
		}
		line1 = (zhyoxy[3] - zhyoxy[1]) / (zhyoxy[2] - zhyoxy[0]);
		for (int i = 0; i < 4; ++i) {
			cin >> zhyoxy[i];
		}
		if (zhyoxy[3] == zhyoxy[1]) {
			hantei[1] = 'y';
		}
		else if (zhyoxy[2] == zhyoxy[0]) {
			hantei[1] = 'x';
		}
		line2 = (zhyoxy[3] - zhyoxy[1]) / (zhyoxy[2] - zhyoxy[0]);
		if ((line1 == line2||zhyoxy[0]==zhyoxy[1])&&line1!=0&&line2!=0) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}