#include	<iostream>
#include	<cstdio>
#include	<cmath>

using namespace std;

int main(void) {
	int ds;
	cin >> ds;
	
	for(int i = 0; i < ds; i++) {
		double X[4], Y[4];
		double a1, a2;
		double b1, b2;
		
		for(int j = 0; j < 4; j++) {
			cin >> X[j] >> Y[j];
		}
		a1 = abs(Y[1] - Y[0]);
		b1 = (X[1] - X[0]);
		
		a2 = abs(Y[3] - Y[2]);
		b2 = (X[3] - X[2]);
		
		a1 /= b1;
		a2 /= b2;
		
		if(a1 == a2) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}