#include <iostream>
#include <algorithm>
using namespace std;

const double EPS = 1e-8;

double outp(double x1, double y1, double x2, double y2) {
  return x1*y2 - y1*x2;
}

int sig(double x) {
  if(x < -EPS) return -1;
  if(x > +EPS) return +1;
  return 0;
}

int main() {
  int N; cin >> N;
  while(N--) {
    double x1, y1, x2, y2, x3, y3, x4, y4;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
    x2 -= x1; y2 -= y1;
    x4 -= x3; y4 -= y3;
    if(sig(outp(x2, y2, x4, y4)) == 0) {
      cout << "YES" << endl;
    }
    else {
      cout << "NO" << endl;
    }
  }
}