#include<iostream>
using namespace std;

int main(){

  int num;
  cin >> num;

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

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

      i++;
  }

  return 0;
}