#include <iostream>
#include <complex>
using namespace std;

#define P complex<double>

int main(){
  int n;
  P a,b,c,d;

  cin >> n;
  for( int loop=0;loop<n;loop++ ){
    cin >> a.real() >> a.imag();
    cin >> b.real() >> b.imag();
    cin >> c.real() >> c.imag();
    cin >> d.real() >> d.imag();

    P x=a-b, y=c-d;
    x = x/abs(x);
    y = y/abs(y);

    if( abs( x-y ) < 1.0e-4 || abs( x+y )<1.0e-4 )
      /*
      abs(x.real()-y.real()) < 1.0e-4  &&
	abs(x.imag()-y.imag()) < 1.0e-4  )
      */
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }

  return 0;
}