/*
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0021&lang=jp
*/

#include<stdio.h>
int main(void)
{
    int n,i;
    double ax,ay,bx,by,cx,cy,dx,dy;
    double slope1,slope2;


    scanf("%d",&n);

    for(i=0;i<n;i++){
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy);

        slope1=(by-ay)/(bx-ax);
        slope2=(dy-cy)/(dx-cx);

        if(slope1==slope2){
            printf("YES");
        }else{
            printf("NO");
        }
    }
    return 0;
}
