#include<iostream>
using namespace std;

int main(){
	double x1, x2, x3, x4, y1, y2, y3, y4;
	double ab_x, ab_y, cd_x, cd_y;
	int n, i;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3>> x4 >> y4;
		ab_x = x1-x2;
		ab_y = y1-y2;
		cd_x = x3-x4;
		cd_y = y3-y4;
		if(ab_y/ab_x == cd_y/cd_x){
			cout << "YES\n";
		}else{
			cout << "NO\n";
		}
	
	}
	return 0;
}