#include <iostream>
#include <math.h>

using namespace std;

void myswap(double* a,double* b)
{
	double temp=*a;
	*a=*b;
	*b=temp;
}
int main()
{
	double x1,x2,x3,y1,y2,y3,x4,y4;
	int n;
	double AB,CD; 

	cin>>n;

	for(int i=0;i<n;i++)
	{
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		if(x1>x2)
		{
			myswap(&x1,&x2);
			myswap(&y1,&y2);
		}
		if(x3>x4)
		{
			myswap(&x3,&x4);
			myswap(&y3,&y4);
		}

		if((x2-x1)==0||(x4-x3)==0)
		{
			if((x2-x1)==0&&(x4-x3)==0)
				cout<<"YES"<<endl;
			else
				cout<<"NO"<<endl;
			continue;
		}
		
		AB=(y2-y1)/(x2-x1);
		CD=(y4-y3)/(x4-x3);

		if((fabs(AB-CD))<0.00001)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;


	}
	

	return 0;
}