#include <complex>
#include <cmath>
#include <iostream>
using namespace std;

typedef complex<double> xy_t;

double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); }

int main(){
  int n;
  cin >> n;
  for(int i=0; i<n; ++i){
    xy_t P[4];
    double x, y;
    for(int j=0; j<4; ++j){
      cin >> x >> y;
      P[j] = xy_t(x, y);
    }
    double area = cross_product(P[1]-P[0], P[3]-P[2]);
    if(area){
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    };

  }
}