#include<iostream>
#include<stdlib.h>
using namespace std;

double x[4];
double y[4];

int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    for(int j=0;j<4;j++){
      cin >> x[j];
      cin >> y[j];
    }
    if(abs((x[1]-x[0])*(y[3]-y[2]))==abs((x[3]-x[2])*(y[1]-y[0]))){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  
  return 0;
}