
#include <iostream>
#include <complex>
#include <cmath>

using namespace std;

typedef complex<double> Point;

int main() {
    int N;
    cin >> N;
    while(N--) {
        Point ps[4];
        for(int i = 0; i < 4; ++i) cin >> ps[i].real() >> ps[i].imag();
        Point v1 = ps[1]-ps[0], v2 = ps[3]-ps[2];
        /*
        double dot = v1.real()*v2.real() + v1.imag()*v2.imag();
        double n = norm(v1) * norm(v2);
        if(abs(dot*dot - n) < 1e-5) cout << "YES" << endl;
        else cout << "NO" << endl;
        */
        if(abs(arg(v1)-arg(v2)) < 1e-7) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}