#include<cmath>
#include<vector>
#include<iostream>

#define	EPS		1e-9
#define	pb(a)	push_back(a);

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

Point operator -(const Point &a,const Point &b)
{
	Point c=a;
	c-=b;
	return c;
}

class Line : public vector<Point>{
public:
	Line(const Point &a,const Point &b){
		pb(a);
		pb(b);
	}
};

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

bool parallel(const Line &l,const Line &m)
{
	return abs(cross(l[1]-l[0],m[1]-m[0]))<EPS;
}

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;
		Line l(p[0],p[1]),m(p[2],p[3]);
		cout<<(parallel(l,m)?"YES":"NO")<<endl;
	}
	return 0;
}