import std.stdio, std.string, std.algorithm, std.conv, std.range, std.math;

void main() {
  int n = readln.chomp.to!int;

  for (int i = 0; i < n; i++) {
    auto p = readln.chomp.split.map!(to!double);

    auto ab = (p[3] - p[1]) / (p[2] - p[0]);
    auto cd = (p[7] - p[5]) / (p[6] - p[4]);

    if (ab == cd) {
      writeln("YES");
    } else {
      writeln("NO");
    }
  }
}