#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]*y[3]-x[2]*y[4]-x[1]*y[3]+x[1]*y[4]-x[3]*y[2]+x[4]*y[2]+x[3]*y[1]-x[4]*y[1]){
            printf("NO\n");
        }else{
            printf("YES\n");
        }
    }
}