#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  scanf("%d", &n);

  for (int c = 0; c < n; ++c) {
    double input[8];
    for (int i = 0; i < 8; ++i) {
      scanf("%lf", &input[i]);
    }
    double k1 = (input[3] - input[1]) / (input[2] - input[0]);
    double k2 = (input[7] - input[5]) / (input[6] - input[4]);

    if (abs(k1 - k2) < 0.00000001) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}