#include<iostream>
#include<cmath>
using namespace std;
#define EPS 1e-10
double x1,y1,x2,y2,x3,y3,x4,y4;
double det(){
	double dx1,dy1,dx2,dy2;
	dx1 = x1-x2;
	dy1 = y1-y2;
	dx2 = x3-x4;
	dy2 = y3-y4;
	return dx1*dy2 - dy1*dx2;
}
int main(){
	int n;
	cin>>n;
	while(n--){
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		cout<<(fabs(det())<EPS?"YES":"NO")<<endl;
	}
	return 0;
}