#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n;
  cin >> n;
  while (n--){
    double x[4], y[4];
    bool f = false;
    for (int i = 0; i < 4; i++) cin >> x[i] >> y[i];
    if (x[0] - x[1] == x[2] - x[3] && y[0] - y[1] == y[2] - y[3]){
      f = true;
    }

    if (f){
      cout << "YES\n";
    }
    else {
      cout << "NO\n";
    }
  }
}