#include <iostream>
#include <complex>
using namespace std;
#define REP(i, n)       REPEAT(i, 0, n)
#define REPEAT(i, k, n) for (int i = (k); i < (n); ++i)

#define X real()
#define Y imag()
typedef double D;
typedef complex<D>P;
#define EPS (1e-10)
#define DEQ(p1,p2) (abs((p1)-(p2)) < EPS)
 
inline D outprd(const P &a, const P &b){ return (conj(a) * b).Y; }
bool is_parallel(const P &a, const P &b, const P &c, const P &d){
    return DEQ(outprd(a-b, c-d), 0.0);
}

int main(){
    int n;
    cin >> n;
    REP(i,n){
        double x1, y1, x2, y2, x3, y3, x4, y4;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
        P p1(x1,y1), p2(x2,y2), p3(x3,y3), p4(x4,y4);
        if(is_parallel(p1,p2,p3,p4)){
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}