#include <cstdio>
using namespace std;

typedef struct{
  double x,y;
}point;

int main(void){
  int i,n;
  char str[200];
  point A,B,C,D;

  fgets(str,sizeof(str),stdin);
  sscanf(str,"%d",&n);
  for(i=0;i<n;i++){
    fgets(str,sizeof(str),stdin);
    sscanf(str,"%lf %lf %lf %lf %lf %lf %lf %lf",&A.x,&A.y,&B.x,&B.y,&C.x,&C.y,&D.x,&D.y);
    if((B.y-A.y)/(B.x-A.x) == (D.y-C.y)/(D.x-C.x)){
      printf("YES\n");
    }
    else{
      printf("NO\n");
    }
  }
  return 0;
}