#include <bits/stdc++.h>

using namespace std;

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 (cx[1] != cx[0] && cx[3] != cx[2]) {
      double kx = (cy[1] - cy[0]) / (cx[1] - cx[0]);
      double ky = (cy[3] - cy[2]) / (cx[3] - cx[2]);
      if (abs(kx - ky) < 0.0001) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    } else if (cx[1] == cx[0] && cx[3] == cx[2]) {
      cout << "YES" << endl;
    } else if (cy[1] == cy[0] && cy[3] == cy[2]) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}