module main;
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.math;
import std.array;

auto EPS = 0.00000001;

void pr(bool b)
{
  writeln(b ? "YES" : "NO");
}

void main()
{
  auto n = to!int(chomp(readln));
  for(int i = 0; i < n; i++)
  {
    auto p = map!(to!double)(readln.split).array;
    double dx1 = p[0] - p[2], dx2 = p[4] - p[6], dy1 = p[1] - p[3], dy2 = p[5] - p[7];
    if(abs(dx1) < EPS || abs(dx2) < EPS)
      pr(abs(dx1) < EPS && abs(dx2) < EPS);
    else
      pr(dy1 / dx1 - dy2 / dx2 < EPS); 
  }
}