#include<iostream>
using namespace std;

int main(){
	int n;
	double a1,a2,b1,b2,c1,c2,d1,d2;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2;
		if(((a1-b1)/(a2-b2))==((c1-d1)/(c2-d2)))cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}

}