#include<iostream>
#include<string>

using namespace std;

int N;
double X[4], Y[4];
long long ad, bc;

string parallel_judge(){
	ad = (X[1] * 100000 - X[0] * 100000)*(Y[3] * 100000 - Y[2] * 100000);
	bc = (Y[1] * 100000 - Y[0] * 100000)*(X[3] * 100000 - X[2] * 100000);
	if (ad - bc == 0){
		return "YES";
	}
	else{
		return "NO";
	}
}

int main()
{
	cin >> N;
	for (int i = 0; i < N; i++){
		for (int j = 0; j < 4; j++){
			cin >> X[j] >> Y[j];
		}
		cout << parallel_judge() << endl;
	}
}