#include <iostream>

using namespace std;

int main(){
  int a,b,c,d,e,f,g,h;
  int n;
  cin>>n;
  while(n--){
    cin>>a>>b>>c>>d>>e>>f>>g>>h;
    if((c-a)/(d-b)==(g-e)/(h-f))cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}
  return 0;
}