#include <iostream>
#include <cstdio>
using namespace std;

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		float x[4], y[4];
		for(int j = 0; j < 4; j++){
			cin >> x[j] >> y[j];
		}
	//	float ab = 99999999, cd = 99999999;
	//	if(x[0] != x[1]) ab = (y[0]-y[1]) / (x[0]-x[1]);
	//	if(x[2] != x[3]) cd = (y[2]-y[3]) / (x[2]-x[3]);
	//	if(ab == cd) cout << "YES"<< endl;
	//	else cout << "NO" << endl;

		puts((y[1]-y[0])/(x[1]-x[0]) == (y[3]-y[2])/(x[3]-x[2])?"YES":"NO");
	}
	return 0;
}