#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n;i>=0;i--)
#define all(v) v.begin(),v.end()
template<typename T>T rad(T deg){return deg*M_PI/180;}
using namespace std;
int main() {
    int n;
    cin >> n;
    rep(j,n) {
        complex<double> a[4];
        rep(i, 4) {
            double x, y;
            cin >> x >> y;
            a[i] = *(new complex<double>(x, y));
        }
        complex<double> vAB = a[0] - a[1];
        complex<double> vCD = a[2] - a[3];
        double m1 = arg(vAB);
        double m2 = arg(vCD);
        cout << ((m1==m2) ? "YES" : "NO") << endl;
    }
}