#include<iostream>
using namespace std;
int main(){
  int n;
  double x[4],y[4],bell1,hess1,bell2,hess2;
  cin >> n;
  for(int t=0;t<n;t++){
    for(int i=0;i<4;i++){
      cin >> x[i] >> y[i];
    }
    bell1=x[0]-x[1];
    hess1=y[0]-y[1];
    bell2=x[2]-x[3];
    hess2=y[2]-y[3];
    if(bell1==bell2 && hess1==hess2){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
  }
}