#include<iostream>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ;  i++)
int main(void){
	int n;
	cin>>n;
	rep(k,n){
		double x[4];
		double y[4];
		double ans[2];
		rep(i,4)cin>>x[i]>>y[i];
    ans[0]=(y[1]-y[0])/(x[1]-x[0]);
    ans[1]=(y[3]-y[2])/(x[3]-x[2]);
		if(ans[0]==ans[1])cout<<"YES";
		else cout<<"NO";
		cout<<endl;
	}
}