#include<iostream>
using namespace std;

int main(){

  int num;
  cin >> num;

  double x[4], y[4];
  int i = 0;

  while( i < num ){
  for( int j = 0; j < 4; j++ ){
    cin >> x[j] >> y[j];
  }
  double comp1 = (y[1]- y[0]) / (x[1] - x[0]) ;
  double comp2 = (y[3] - y[2]) / (x[3] - x[2]);
  if(comp1 == comp2 || comp1 * (-1) == comp2 ){
    cout <<"YES"<< endl;
  }else{
    cout <<"NO"<< endl;
  }
  i++;
  }

 
  return 0;
}