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

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];
    writeln(dy1 / dx1 - dy2 / dx2 ? "NO" : "YES"); 
  }
}