#include<iostream>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<algorithm>

using namespace std;

int main(void)
{
  double x=0.0,y=0.0;
  double x1=0.0,y1=0.0;
  int n=0;
  int i=0;
  double a,b;

  cin>>n;

  for(i=0;i<n;i++)
    {
      cin>>x>>y>>x1>>y1;
      a=(y1-y)/(x1-x);

      cin>>x>>y>>x1>>y1;
      b=(y1-y)/(x1-x);
	
      if(a==b)
        puts("YES");
      else
        puts("NO");
    }

}