#include<iostream>
using namespace std;
int main(){
  double a[2],b[2],c[2],d[2];
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    for(int j=0;j<2;j++) cin >> a[j] >> b[j] >> c[j] >> d[j];
    if(a[0]-b[0]==0&&c[0]-d[0]==0) cout << "YES" << endl;
    else if(a[1]-b[1]==0&&c[1]-d[1]==0) cout << "YES" << endl;
    if(a[0]-b[0]!=0&&c[0]-d[0]!=0){
    if((a[1]-b[1])/(a[0]-b[0])==(c[1]-d[1])/(c[0]-d[0])) cout << "YES" << endl;
    }
    else cout << "NO" << endl;
  }   
  return 0;
}