#include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;

typedef struct{
    double x;
    double y;
}vec;

int main(){
    int n;
    vec p[4];
    cin >> n;
    while(n--){
        for(int i=0;i<4;i++)
            cin >> p[i].x >> p[i].y;
        p[0].x-=p[1].x;
        p[0].y-=p[1].y;
        p[2].x-=p[3].x;
        p[2].y-=p[3].y;
        if((int)(p[0].x*p[2].y-p[0].y*p[2].x)==0) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}