#include <iostream>
#include <cmath>
#include <complex>

#define EPS 1e-10;

struct POINT_DOUBLE {
  double x;
  double y;
};

struct VECTOR_DOUBLE {
  double x;
  double y;

  VECTOR_DOUBLE(const POINT_DOUBLE& pt1, const POINT_DOUBLE& pt2) {
    x = pt2.x - pt1.x;
    y = pt2.y - pt1.y;
  }

  double Angle() const {
    return atan(y / x);
  }
};

std::istream& operator >> (std::istream& is, POINT_DOUBLE& p)
{
  is >> p.x >> p.y;
  return is;
}

static bool IsParallel(const VECTOR_DOUBLE& vec1, const VECTOR_DOUBLE& vec2)
{
  return std::abs(vec1.Angle() - vec2.Angle()) < EPS;
}

int main(void)
{
  int n;
  std::cin >> n;

  for (int i = 0; i < n; i++) {
    POINT_DOUBLE pt1, pt2, pt3, pt4;
    std::cin >> pt1 >> pt2 >> pt3 >> pt4;

    VECTOR_DOUBLE vec1(pt1, pt2);
    VECTOR_DOUBLE vec2(pt3, pt4);

    std::cout << (IsParallel(vec1, vec2) ? "YES" : "NO") << std::endl;
  }

  return 0;
}

