#include<iostream>
#define INF 10000000
using namespace std;
int main(){
  int n;
  double lI,lII,x1,y1,x2,y2,x3,y3,x4,y4;
  cin >> n;
  while(n--){
    cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
    x1+=1000,y1+=1000,x2+=1000,y2+=1000,x3+=1000,y3+=1000,x4+=1000,y4+=1000;
    x2-=x1,y2-=y1,x4-=x3,y4-=y3;
    cout << ((x2==0&&x4==0)||(y2/x2 == y4/x4)?"YES":"NO") << endl;
  }
}