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

class vec2d {
public:
  double x,y;
  vec2d() {
    this->x = 0;
    this->y = 0;
  }
  void set(double x,double y) {
    this->x = x - this->x;
    this->y = y - this->y;
  }
};

int main() {
  int n;
  cin >> n;
  while(n--) {
    double x,y;
    vec2d p[4];
    for(int i=0;i<4;i++) {
      cin >> x >> y;
      p[i].set(x,y);
    }
    double tanAB = (p[1].x - p[0].x) / (p[1].y - p[0].y);
    double tanCD = (p[3].x - p[2].x) / (p[3].y - p[2].y);
    if((tanAB - tanCD)*(tanAB - tanCD) < 10e-9) {
      cout << "YES" << endl;
    }
    else {
      cout << "NO" << endl;
    }
  }
}