// inami 氏の回答

#include <iostream>
using namespace std;
 
struct cd{ //coordinate : 座標
    double x,y;
};
 
int main(){
    int n;
    struct cd a[4];
 
    cin>>n;
    for(int i=0; i<n; i++){
        for(int i=0; i<4; i++){
            cin>>a[i].x>>a[i].y;
        }
 
        //tilt : 傾き
        double tilt1=(a[1].y-a[0].y) / (a[1].x-a[0].x);
        double tilt2=(a[3].y-a[2].y) / (a[3].x-a[2].x);
 
        if(tilt1==tilt2) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
     
    return 0;
}