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

int main(){
  int n;
  double ax,ay,bx,by,cx,cy,dx,dy;

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> ax >> ay >> bx >> by >> cx >> cy >> dx >> dy;
    if( abs( (ay-by)/(ax-bx) - (cy-dy)/(cx-dx) ) < 1e-10)cout << "YES\n";
    else cout << "NO\n";
  }
}