#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;}
template<typename T>bool eq(T a,T b){return ((a-b)<=1e-8)?true:false;}
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];
        if (eq(vAB.real(), 0.0)) {
            cout << ((eq(vCD.real(), 0.0)) ? "YES" : "NO") << endl;
        } else if(eq(vCD.real(),0.0)){
            cout << ((eq(vAB.real(), 0.0)) ? "YES" : "NO") << endl;
        }else{
            double m1 = vAB.imag() / vAB.real();
            double m2 = vCD.imag() / vCD.real();
            cout << ((eq(m1, m2)) ? "YES" : "NO") << endl;
        }
    }
}