#include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>
#include<memory>
#include<array>

using namespace std;

int main()
{
  array<double, 4> x;
  array<double, 4> y;

  int n;
  cin >> n;

  for ( auto j = 0; j < n; ++j )
    {
      for ( auto i = 0; i < 4; ++i )
        {
          cin >> x[i];
          cin >> y[i];
        }
      
      double abx = x[1] - x[0];
      double aby = y[1] - y[0];
      double cdx = x[3] - x[2];
      double cdy = y[3] - y[2];
      
      if ( abx * cdy - aby * cdx == 0 )
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  
  return 0;
}