#include <stdio.h>

int main(){
    int n;
    double x[5],y[5];
    int i,j;
    scanf("%d",&n);
    for(j=0;j<n;j++){
        for(i=1;i<5;i++)scanf("%lf %lf",&x[i],&y[i]);
        if((x[2]-x[1])*(y[3]-y[4])-(y[2]-y[1])*(x[3]-x[4])){
            printf("NO\n");
        }else{
            printf("YES\n");
        }
    }
}