#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 x1, y1, x2, y2, x3, y3, x4, y4;
for(int i = 0; i < n; i++){
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
	vec v1 = P(x1, y1);
	vec v2 = P(x2, y2);
	vec v3 = P(x3, y3);
	vec v4 = P(x4, y4);
	vec a = sub(v1, v2);
	vec b = sub(v3, v4);
	if (cross(a, b) == 0)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
return 0;

}
