#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;
  }
  void set(vec2d vec) {
    this->x = vec.x - this->x;
    this->y = vec.y - this->y;
  }
};
double cross(vec2d A,vec2d B) {
  return (A.x*B.y - B.x*A.y);
}
bool is_paralles(vec2d A,vec2d B) {
  if(cross(A,B) == 0.0) return true;
  return false;
}

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);
    }
    p[0].set(p[1]);
    p[2].set(p[3]);
    if(is_paralles(p[0],p[2])) {
      cout << "YES" << endl;
    }
    else {
      cout << "NO" << endl;
    }
  }
}