#include<bits/stdc++.h>
using namespace std;
signed main(void){
	double k1,k2;
	double x[4],y[4];
	int T;
	cin>>T;
	for(int t=1;t<=T;t++){
		for(int i=0;i<4;i++)
			cin>>x[i]>>y[i];
		k1=(y[1]-y[0])/(x[1]-x[0]);
		k2=(y[3]-y[2])/(x[3]-x[2]);
		if(fabs(k1-k2)<=1e-6)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}