#include <iostream>
using namespace std;
#define INF 1e+15

int main(){
  double x[4], y[4];
  int n;
  cin >> n;
  while( n-- ){
    cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
    double tan[2];
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        if ( x[i*2] == x[i*2+1] ) {
          tan[i] = INF;
        } else {
          tan[i] = (y[i*2]-y[i*2+1]) / (x[i*2]-x[i*2+1]);
        }
      }
    }
    if ( tan[0] == tan[1] ) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}