#include<iostream>
using namespace std;

int main(){
  int n = 0;
  cin >> n;
  for(int i=0;i<n;i++){

    double x1 = 0.0;
    double y1 = 0.0;
    double x2 = 0.0;
    double y2 = 0.0;
    double x3 = 0.0;
    double y3 = 0.0;
    double x4 = 0.0;
    double y4 = 0.0;

    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

    double a = (y2 - y1) / (x2 - x1);
    double b = (y4 - y3) / (x4 - x3);
    double d = (y3 - y4) / (x3 - x4);
    double x = (y3 - y1) / (x3 - x1);

    if((a == b || a == d) && (a != x)){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
  }

  return 0;
}