#include <iostream>
#include <cmath>

using namespace std;

void swap(double &x, double &y, double &xx, double &yy) 
{
  double tmp_x = x;
  double tmp_y = y;
  x = xx;
  y = yy;
  xx = tmp_x;
  yy = tmp_y;
}

void compute(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) 
{
  if (x1 > x2) swap(x1, y1, x2, y2);
  if (x3 > x4) swap(x3, y3, x4, y4);

  double diff_x12 = x2 - x1;
  double diff_y12 = y2 - y1;
  double diff_x34 = x4 - x3;
  double diff_y34 = y4 - y3;

  if (diff_x12 != 0 && diff_x34 != 0) {
    if (diff_y12 == 0.0 && diff_y34 == 0.0)
      cout << "YES" << endl;
    else {
      double ab = diff_y12 / diff_x12;
      double cd = diff_y34 / diff_x34;
      if (abs(ab - cd) < 0.00001)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  else if (diff_x12 == 0.0 && diff_x34 == 0.0) {
    cout << "YES" << endl;  
  }
  else
    cout << "NO" << endl;  
}

int main(void) 
{
  int n;
  cin >> n;
  for (int i=0; i < n; i++) {
    double x1, y1, x2, y2, x3, y3, x4, y4;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
    compute(x1, y1, x2, y2, x3, y3, x4, y4);
  }
  
  return 0;
}