#include<iostream>
#define INF 10000000
using namespace std;
int main(){
  int n;
  double lI,lII,x1,y1,x2,y2,x3,y3,x4,y4;
  cin >> n;
  while(n--){
    cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
    //x2-x1が0になったらOUT?
    /*  lI = lII = INF;
    if(x1!=x2) lI = (y2-y1)/(x2-x1);
    if(x3!=x4) lII = (y4-y3)/(x4-x3);*/
    x2-=x1,y2-=y1,x4-=x3,y4-=y3;
    cout << ((x2==0&&x4==0)||(y2/x2 == y4/x4)?"YES":"NO") << endl;
  }
}