#include <iostream>
#include <cmath>

using namespace std;

#define EPS 1e-5

int main(){
  double a,b,c,d,e,f,g,h;
  int t;

  cin >> t;
  while(t--){
    cin >> a >> b >> c >> d >> e >> f >> g >> h;
    
    c -= a,d -= b,g -= e,h -= f;
    
    cout << (fabs(c*g-d*h) > EPS ? "NO" : "YES") << endl;
  }
  
  return 0;
}