#include<iostream>
#include<algorithm>
using namespace std;
 
int main(){
 
  double ax,ay,bx,by,cx,cy,dx,dy;
  double n,s,t;
 
  cin >> n;
 
  for(int i=0;i<n;i++){
    cin >> ax >> ay >> bx >> by >> cx >> cy >> dx >> dy;
 
    s = (ay - by) / (ax - bx);
    t = (cy - dy) / (cx - dx);
 
    if(s == t) cout << "YES" << endl;
    else cout << "NO" << endl;
 
  }
}