#include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
double c[8];
for(int b=0;b<a;b++){
    for(int d=0;d<8;d++)scanf("%lf",&c[d]);
    if(c[0]==c[1]&&c[2]==c[3])printf("YES\n");
    else if((c[1]-c[0])*(c[7]-c[6])==(c[3]-c[2])*(c[5]-c[4]))printf("YES\n");
    else printf("NO\n");
    }
}