#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;
  cin>>n;
  rep(i,n){
    double a=543.5,b=629.3;
    double ax,ay,bx,by,cx,cy,dx,dy;
    cin>>ax>>ay>>bx>>by>>cx>>cy>>dx>>dy;

    //if(by-ay)/(bx-ax)=(dy-cy)/(dx-cx)
    if((by-ay)*(dx-cx)==(bx-ax)*(dy-cy))cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
}