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

int main(){
	double N,xx,yy;
	long long X[5],Y[5];
	cin>>N;
	for(int j=1;j<=N;j++){
		for(int i=1;i<=4;i++){
			cin>>xx>>yy;
			X[i]=(int)(xx*100000.0);
			Y[i]=(int)(yy*100000.0);
		}
		if((X[2]-X[1])*(Y[4]-Y[3])==(X[4]-X[3])*(Y[2]-Y[1])){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}