#include <iostream>
using namespace std;
int main()
{
	int n; cin >> n ;
	double x[4],y[4];
	while(n--)
	{
		for(int i=0;i<4;i++) cin >> x[i] >> y[i] ;
		double vx[2],vy[2];
		for(int i=0;i<2;i++) vx[i]=x[2*i+1]-x[2*i], vy[i]=y[2*i+1]-y[2*i];
		bool failed=false;
		for(int i=0;i<2;i++) if(!vx[i] && !vy[i]) failed=true;
		if(failed) cout << "NO" << '\n';
		else if((long double) vx[0]*vy[1]==(long double) vy[0]*vx[1]) cout << "YES" << '\n' ;
		else cout << "NO" << '\n' ;
	}
}