#include <iostream>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;
double cross_product(xy_t a, xy_t b) {
    return(conj(a)*b).imag(); 
}

int main() {
    int n;
    cin >> n;
    for (int task = 0; task < n; task++) {
        xy_t p[4];
        double x[4], y[4], eps = 1e-11;
        for (int i = 0; i < 4; i++) cin >> x[i] >> y[i];

        xy_t a[2];
        a[0] = xy_t(x[0], y[0]) - xy_t(x[1], y[1]);
        a[1] = xy_t(x[2], y[2]) - xy_t(x[3], y[3]);

        bool b = abs(cross_product(a[0], a[1])) / 2.0 < eps;
        cout << (b ? "YES" : "NO") << endl;
    }
}

/*
g++ -std=c++14 pr_prog/_main.cpp
 */
