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

void main() {
    uint count = to!uint(readln().chomp);
    for (uint i = 0; i < count; ++i) {
        double[] t = map!(to!double)(readln().chomp.split).array;
        double[] a = [t[0]-t[2], t[1]-t[3]];
        double[] b = [t[4]-t[6], t[5]-t[7]];
        if (is_zero(outer_product2(a, b))) {
            writeln("YES");
        } else {
            writeln("NO");   
        }
    }
}

bool is_zero(double x) {
    if (abs(x) < 0.0000001) {
        return true;
    } else {
        return false;
    }
}

double outer_product2(double[] a, double[] b) {
    return a[0]*b[1] - a[1]*b[0];
}