#include<cmath>
#include<iostream>

#define	EPS		1e-9

using namespace std;

class Point{
public:
	double x,y;
	Point(){}
	Point(double xx,double yy) : x(xx),y(yy){}
};

Point &operator -=(Point &a,const Point &b)
{
	a.x-=b.x;
	a.y-=b.y;
	return a;
}

double cross(const Point &a,const Point &b)
{
	return a.x*b.y-a.y*b.x;
}

int main()
{
	int n;	cin>>n;
	while(n--){
		Point p[4];
		for(int i=0;i<4;i++)	cin>>p[i].x>>p[i].y;
		p[1]-=p[0];
		p[3]-=p[2];
		if(abs(cross(p[1],p[3]))<EPS)	cout<<"YES"<<endl;
		else	cout<<"NO"<<endl;
	}
	return 0;
}