#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
	double x1,y1,x2,y2,x3,y3,x4,y4;
	bool f=0;
	cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
	double yy1=(y2-y1),yy2=y4-y3;
	if(yy1==0)yy1=0.0000001;
	if(yy2==0)yy2=0.0000001;
	double r1=(x2-x1) / (y2-y1);
	double r2=(x4-x3) / (y4-y3);
	if(abs(r1-r2 ) <=0.000001  )f=1;
	if(f)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	}
	return 0;
}