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

int main(){
	int n;cin >> n;
	double a[8];
	while(n--){
		for(int i = 0;i < 8;i++)cin >> a[i];
		double y1 = a[3]-a[1];double x1 = a[2]-a[0];
		double y2 = a[7]-a[5];double x2 = a[6]-a[4];
		if(!x1 || !x2){
			if(!x1 && !x2)cout << "YES" << endl;
			else cout << "NO";
		}else{
			if(y1/x1 == y2/x2)cout << "YES" << endl;
			else cout << "NO" << endl;
		}
	}
	return 0; 
}