#include<iostream>
#include<cstdio>
#include<string>
//#define nINF -2147483648
using namespace std;
/*
int p10(int x)  //10^x
{
	int d141771=1; for (int i=1;i<=x;i++) d141771*=10; return d141771;
}
*/
int main()
{
	double x1,y1,x2,y2,x3,y3,x4,y4,k1,k2,z1,z2,z3,z4;
	int n;
	cin>>n;
	bool up1,up2;
	for (int k=1;k<=n;k++)
	{
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		k1=0; k2=0;
		up1=false; up2=false;
		z1=y1-y2; z2=x1-x2;
		z3=y3-y4; z4=x3-x4;
		if (z2==0) up1=true;
		if (z4==0) up2=true;
		if (z2!=0) k1=z1/z2;
		if (z4!=0) k2=z3/z4;
		if (z2!=0&&z4!=0)
		{
			if (k1==k2) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}
		else
		{
			if (k1==k2&&up1==up2) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}
	}
	return 0;
}