#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
  int n;
  double x[4],y[4];
  cin>>n;
  for(;n--;){
    for(j=0;j<4;j++){
      cin>>x[j];
      cin>>y[j];
    }

    if((x[0]-x[1])*(y[2]-y[3])==(x[2]-x[3])*(y[0]-y[1]))cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}