#include <iostream>
using namespace std;

typedef struct P {
	double x, y;
}P;
int n;
double a1, a2, b1, b2, c1, c2;
P p[4];

int main(){
	cin >> n;
	for (int l = 0; l < n; l++) {
		for (int i = 0; i < 4; i++) {
			cin >> p[i].x >> p[i].y;
		}
		a1 = p[0].x - p[1].x;
		a2 = p[0].y - p[1].y;
		b1 = p[2].x - p[3].x;
		b2 = p[3].y - p[3].x;
		c1 = a1*b1;
		c2 = a2*b2;
		c2 -= c1;
		if (c2 < 0.00001 && c2 > -0.00001) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}

	return 0;
}