#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;
int n;
double ax,ay,bx,by,cx,cy,dx,dy;
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>ax>>ay>>bx>>by>>cx>>cy>>dx>>dy;
		if((ax-bx)*(cy-dy)==(ay-by)*(cx-dx))cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}