#include<iostream>

using namespace std;

int main(void){
    int n;
    double x[4],y[4];
    double ansx[2],ansy[2];
    cin>>n;
    for(int i = 0 ; i < n ;  i ++){	
      for(int j = 0 ; j < 4 ; j ++)cin>>x[i]>>y[i];
      for(int j = 0 ; j < 4 ; j +=2){
	ansx[i]=ansx[i]-ansx[i+1];
	ansy[i]=ansy[i]-ansy[i+1];
      }
      if(ansx[0]*ansy[1]-ansx[1]*ansy[0])
	cout<<"NO"<<endl;
      else
	cout<<"YES"<<endl;

    }
}