#include<iostream>
using namespace std;

int main(){
    int n;
    double x1, x2, x3, x4, y1, y2, y3, y4;
    cin >> n;
    for(; n; n--){
        cin >>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
        double px[2], py[2];
        px[0] = x2 - x1;
        px[1] = x4 - x3;
        py[0] = y2 - y1;
        py[1] = y4 - y3;
        if(px[0]*py[1] == px[1]*py[0]){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
    return 0;
}