#include <iostream>

using namespace std;
 
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;
    cout << (((d-b)/(c-a)) == ((h-f)/(g-e)) ? "YES" : "NO") << endl;
  }
 
  return 0;
}