#include <iostream>
using namespace std;
int main(void){
    
int n;
cin >> n;
double D[8];
for(int i = 0; i < n; i++){
	for(int j = 0; j < 8; j++)
		cin >> D[j];
	double a = (D[1] - D[3]) / (D[0] - D[2]);
	double b = (D[5] - D[7]) / (D[4] - D[6]);
	if (a == b)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
return 0;

}
