#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(a==c||e==g)cout<<(a==c&&e==g?"YES":"NO")<<endl;
		cout<<((d-b)/(c-a)==(h-f)/(g-e)?"YES":"NO")<<endl;
	}
}

