#include<iostream>
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(c-a==0||g-e==0)
		{
			cout<<(c-a==g-e?"YES":"NO")<<endl;
		}
		else
		{
			cout<<((d-b)*(g-e)==(h-f)*(c-a)?"YES":"NO")<<endl;
		}
	}
}

