//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;
};

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;

		//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.001)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}