#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
    pair<double,double>a[4];
    for(int i=0;i<4;i++){
        cin>>a[i].first>>a[i].second;
    }
    if((a[1].second-a[0].second)/(a[1].first-a[0].first)!=(a[3].second-a[2].second)/(a[3].first-a[2].first))
        cout<<"NO"<<endl;
    else cout<<"YES"<<endl;
    }
    return 0;
}