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

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