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

void main()
{
    foreach(_;0..readln().chomp().to!int())
    {
        auto m = readln().split().map!(to!real);
        immutable x1=m[0], y1=m[1], x2=m[2], y2=m[3], x3=m[4], y3=m[5], x4=m[6], y4=m[7];
        writeln((x1-x2)*(y3-y4)==(x3-x4)*(y1-y2)?"YES":"NO");
    }
}