#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;cin>>n;
  for(int i=0;i<n;++i){
    vector<pair<double, double>> coordinates;
    for(int j=0;j<4;++j){
      double a,b;cin>>a>>b;
      coordinates.emplace_back(make_pair(a,b));
    }
    int tan1,tan2;
    tan1 =10000*fabs((coordinates[2].second-coordinates[1].second)/(coordinates[2].first-coordinates[1].first));
    tan2 =10000*fabs((coordinates[4].second-coordinates[3].second)/(coordinates[4].first-coordinates[3].first));
   // cout<<tan1<<" "<<tan2<<endl;
    tan1 == tan2 ? cout<<"YES"<<endl : cout<<"NO"<<endl;
  }
  return EXIT_SUCCESS;
}