#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)
class Point{
  public:
  double x,y;
  Point(double x=0,double y=0):x(x),y(y){}
  Point operator + (Point p){return Point(x+p.x,y+p.y);}
  Point operator - (Point p){return Point(x-p.x,y-p.y);}
  Point operator * (double a){return Point(a*x,a*y);}
  Point operator / (double a){return Point(x/a,y/a);}
  bool operator < (const Point &p) const{
    return x!=p.x?x<p.x:y<p.y;
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x)<EPS&&fabs(y-p.y)<EPS;
  }
};
struct seg{Point p1,p2;};
//??????
double dot(Point a,Point b){
  return a.x*b.x+a.y*b.y;
}
//??????
double cross(Point a,Point b){
  return a.x*b.y-a.y*b.x;
}
//??´?????????
bool C90(seg s1,seg s2){
  return equals(dot(s1.p2-s1.p1,s2.p2-s2.p1),0.0);
}
bool C0(seg s1,seg s2){
  return equals(cross(s1.p2-s1.p1,s2.p2-s2.p1),0.0);
}


main(){
  int n;
  cin>>n;
  while(n--){
    seg a,b;
    cin>>a.p1.x>>a.p1.y>>a.p2.x>>a.p2.y;
    cin>>b.p1.x>>b.p1.y>>b.p2.x>>b.p2.y;
    if(C0(a,b))cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
}