#include <iostream>
using namespace std;
typedef struct vec vec;

struct vec {
	double x, y;
};

static vec P(double x, double y){
	vec P = {x, y};
	return P;
}

static vec sub(vec a, vec b){
	return P(a.x - b.x, a.y - b.y);
}

static double cross(vec a, vec b){
	return (a.x * b.y - a.y * b.x);
}

int main(void){
    
int n;
cin >> n;
double D[8];
vec V[4];
for(int i = 0; i < n; i++){
	for(int j = 0; j < 4; j++){
		cin >> D[2*j] >> D[2*j+1];
		V[j] = P(D[2*j], D[2*j+1]);
	}
	vec a = sub(V[0], V[1]);
	vec b = sub(V[2], V[3]);
	if (cross(a, b) == 0)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
return 0;

}
