#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  int n; cin >> n;
  for (int _ = 0; _ < n; ++_) {
    double xa, ya, xb, yb; cin >> xa >> ya >> xb >> yb;
    double th0 = atan2(yb - ya, xb - xa);
    double xc, yc, xd, yd; cin >> xc >> yc >> xd >> yd;
    double th1 = atan2(yd - yc, xd - xc);
    cout << (abs(th1 - th0) < 1e-10 ? "YES" : "NO") << '\n';
  }
}
