#include <bits/stdc++.h>

using namespace std;

#define EQ(x, y) (abs(x - y) < 0.000001)

int main() {
  int n; 
  cin >> n;

  double cx[4], cy[4];
  for (int i = 0 ; i < n; ++i) {
    for (int j = 0; j < 4; j++)
      cin >> cx[j] >> cy[j];
    
    if (EQ(cx[1], cy[0]) && EQ(cx[3], cx[2])) {
      if (EQ(cy[1], cy[0]) || EQ(cy[3], cy[2])) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    } else if (EQ(cx[1], cx[0]) || EQ(cx[3], cx[2])) {
      cout << "NO" << endl;
    } else if (!EQ(cx[1], cx[0]) && !EQ(cx[3], cx[2])) {
      double k1 = (cy[1] - cy[0]) / (cx[1] - cx[0]);
      double k2 = (cy[3] - cy[2]) / (cx[3] - cx[2]);
      if (EQ(k1, k2)) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
}