//0021 Parallelism

//x1,y1,x2,y2,x3,y3,x4,y4ª^¦çê½Æ«A_1,2ðÊé§íÆ_3,4ðÊé¼üª½s©»èµÈ³¢
//È¨A_ÌÀWÍ»ê¼ê|100Èã100ÈºÌÀÆ·é


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

struct Point
{
	Point(){}
	Point(double x, double y):x(x),y(y){}
	double x, y;
	const Point operator -(const Point &rhv){return Point(x-rhv.x, y-rhv.y);}
};

bool NearEqual(double x, double y)
{
	const double EPS = 0.001;
	return (abs(x-y) < EPS);
}

int main(void)
{
	int n;
	int i;
	const int N = 4;
	Point p[N];

	cin >> n;
	while(n--)
	{
		for(i = 0; i < N; i++)
			cin >> p[i].x >> p[i].y;

		//ñ_ðÊé¼üÌX«ðßé©
		Point v[N/2];
		double a[N/2];

		for(i = 0; i < N/2; i++)
		{
			v[i] = p[i*2]-p[i*2+1];
		}
		//àµàÇ¿ç©Ìx¬ªª0ÈçA¼ûÆà0Èç½s
		bool nearZero[N/2] = {NearEqual(v[0].x, 0), NearEqual(v[1].x, 0)};
		if( nearZero[0] || nearZero[1] )
		{
			if( nearZero[0] && nearZero[1])
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		//Ç¿çàx¬ªª0ÅÈ¯êÎAX«ðæÁÄä×é
		else
		{
			a[0] = v[0].y / v[0].x;
			a[1] = v[1].y / v[1].x;
			//åÌ¯¶Èç½s
			if(NearEqual(a[0], a[1]))
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}

		/*
		//2ÂÌ_ÌÊuxNgÌ·ðæé
		Point v1(p[0].x-p[1].x, p[0].y-p[1].y),
			v2(p[2].x-p[3].x, p[2].y-p[3].y);

		//KÉë·àe
		if( abs(v1.x*v2.y - v1.y*v2.x) < 0.01)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
			*/
	}
	return 0;
}