#include <iostream>
#include <cmath>

using namespace std;

typedef struct _POINT {
	double x;
	double y;
} POINT;

typedef struct _LINE {
	POINT a;
	POINT b;
} LINE;

bool isParallel (LINE l1, LINE l2) {
	double f1 = l1.b.x - l1.a.x;
	double g1 = l1.b.y - l1.a.y;
	double f2 = l2.b.x - l2.a.x;
	double g2 = l2.b.y - l2.a.y;

	return (fabs(f2*g1 - f1*g2) < 0.00001);
/*
	double det = f2*g1 - f1*g2;
	if (det == 0.0)
		return true;
	else
		return false;
*/
}

int main() {
	LINE ab, cd;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> ab.a.x >> ab.a.y >> ab.b.x >> ab.b.y >> cd.a.x >> cd.a.y >> cd.b.x >> cd.b.y;
		if (isParallel(ab, cd))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}