#include<iostream>
using namespace std;

int main(){
  int n;
  cin>>n;
  while(n--){
    double x1,y1,x2,y2,x3,y3,x4,y4;
    cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
    long long int xx1,yy1,xx2,yy2,xx3,yy3,xx4,yy4;
    xx1 = x1*100000;
    yy1 = y1*100000;
    xx2 = x2*100000;
    yy2 = y2*100000;
    xx3 = x3*100000;
    yy3 = y3*100000;
    xx4 = x4*100000;
    yy4 = y4*100000;

    long long int abx=x1-x2;
    long long int aby=y1-y2;
    long long int cdx=x3-x4;
    long long int cdy=y3-y4;
    if(abx == 0 && cdx == 0){
      cout<<"YES"<<endl;
    }
    else if(abx == 0 || cdx == 0){
      cout<<"NO"<<endl;
    }else if(aby*cdx == cdy*abx)
      cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }
  return 0;
}