#include<bits/stdc++.h>
using namespace std;
signed main(void){
	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];
		if(abs((y[1]-y[0])*(x[3]-x[2])-(x[1]-x[0])*(y[3]-y[2]))<0.0000001) 
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}