#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n;cin>>n;
	for(;n--;)
	{
		double a,b,c,d,e,f,g,h;cin>>a>>b>>c>>d>>e>>f>>g>>h;
		if(abs(c-a)<1e-8||abs(g-e)<1e-8)cout<<(abs(c-a)<1e-8&&abs(g-e)<1e-8?"YES":"NO")<<endl;
		else cout<<(abs((d-b)*(g-e)-(h-f)*(c-a))<1e-8?"YES":"NO")<<endl;
	}
}

