#include <iostream>
using namespace std;

int main(void) {
  int n;
  cin >> n;
  while (n--) {
    double x1, y1, x2, y2;
    double ang1, ang2;
    cin >> x1 >> y1 >> x2 >> y2;
    ang1 = (y2 - y1) / (x2 - x1);
    cin >> x1 >> y1 >> x2 >> y2;
    ang2 = (y2 - y1) / (x2 - x1);

    if (ang1 == ang2) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }

  return 0;
}