#include <iostream>
#include <stdio.h>
#include <complex>
#include <cmath>
using namespace std;
#define rep(i,p) for(int i=0;i<p;i++)
typedef complex<double> xy_t;

// ??????: a.x*b.x
double dot_product(xy_t a, xy_t b) { 
  return (conj(a)*b).real(); 
}
// ??????: a.x*b.y - b.x*a.y
// ????§???¢????¬????????????¢????????????
double cross_product(xy_t a, xy_t b) { 
  return (conj(a)*b).imag(); 
}
// ?????±: ????????¨ p ??????????????´?????? b ????????±
xy_t projection(xy_t p, xy_t b) { 
  return b*dot_product(p,b)/norm(b); 
}
xy_t P[120];
const double eps = 1e-11;
double x[4], y[4];
int N;
int main() {
  cin>>N;//????????°
  for (int t=0; t<N; ++t) {
    for (int i=0; i<4; ++i)
      cin >> x[i] >> y[i]; // x0,y0..x3,y3
      xy_t a[2] = {
      xy_t(x[0],y[0]) - xy_t(x[1],y[1]),
      xy_t(x[2],y[2]) - xy_t(x[3],y[3])
      };
    bool p = abs(cross_product(a[0],a[1])/2) < eps;
    cout << (p ? "YES" : "NO") << endl;
  }
}