#include <iostream>
#include <stack>
#include <stdio.h>
#include <cmath>
using namespace std;
double x[4],y[4];//p,1,2,3
double make_line(double x1,double y1,double x2,double y2){
	double a,b,c;//ax+by+c=0
	if(x1!=x2&&y1!=y2){
		a=(y1-y2)/(x1-x2);
		b=-1;
		c=-a*x1+y1;
	}else if(x1==x2){
		a=1;
		b=0;
		c=-x1;
	}else if(y1==y2){
		a=0;
		b=1;
		c=-y1;
	}
	return a;
}
int main()
{
	int n;
	cin>>n;
	while(n--){
		cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>x[3]>>y[3];
		printf(abs(make_line(x[0],y[0],x[1],y[1])-make_line(x[2],y[2],x[3],y[3]))<=0.000001?"YES\n":"NO\n");
	}
    return 0;
}