
import std.stdio, std.algorithm, std.string, std.array, std.conv;

void main() {
  int times = readln.chomp.to!(int);
  foreach(t; 0..times) {
    double[] p = readln.chomp.split(" ").map!(to!(double)).array;
    bool ans;
    if ((p[0] - p[2]) == 0 && (p[4] - p[6]) == 0) ans = true;
    else if ((p[0] - p[2]) == 0 || (p[4] - p[6]) == 0) ans = false;
    else if
      (((p[1] - p[3]) / (p[0] - p[2])) == ((p[5] - p[7]) / (p[4] - p[6])))
      ans = true;
    else ans = false;
    writeln(ans ? "YES" : "NO");
  }
}