#include<iostream>
#include<string>
using namespace std;
int main(){
	double n,x[4],y[4];
	bool a[100];
	cin>>n;
	for(int i=0;i<n;i++){
		for(int i=0;i<4;i++)
			cin>>x[i]>>y[i];
		double f,g;
		f=(x[0]-x[1])/(y[0]-y[1]);
		g=(x[2]-x[3])/(y[2]-y[3]);
		if(f==g)
			a[i]=true;
		else
			a[i]=false;
	}
	for(int i=0;i<n;i++){
		if(a[i]==true)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}