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

void main(){
    int N = readln.chomp.to!int;
    foreach(i; 0..N){
        real[] data = readln.chomp.map!(to!real).array;
        real[] ab = new real[2], cd = new real[2];
        ab[] = data[0..2][] - data[2..4][];
        cd[] = data[4..6][] - data[6..8][];
        ((ab[0]/ab[1] == cd[0]/cd[1]) ? "YES" : "NO").writeln;
    }
}