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

int main(){

  double ax,ay,bx,by,cx,cy,dx,dy;
  double n,s,t,u,v,w;

  cin >> n;

  for(int i=0;i<n;i++){
    cin >> ax >> ay >> bx >> by >> cx >> cy >> dx >> dy;

    s = ay - by;
    t = ax - bx;
    s = t / s;
   
    u = cy - dy;
    v = cx - dx;
    u = v / u;

    if(s == u) cout << "YES" << endl;
    else cout << "NO" << endl;

  }
}