#include <cstdio>

using namespace std;

double x1,y1,x2,y2,x3,y3,x4,y4;
    

int main()
{
    int n; scanf( "%d\n", &n );
    while( n > 0 ){
        loop:
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &y2, &y2, &y3, &y3, &y4, &y4 );
        double num1 = x2 - x1, num2 = x4 - x3, num3 = y2 - y1, num4 = y4 - y3;
        if( (num1 == 0 && num3 == 0) || (num2 == 0 && num4 == 0 ) )
        {
            printf( "YES\n" );
            n--;
            goto loop;
        }
        else
        {
            num2 /= num1;
            num4 /= num3;
            if( num3 == num4 || num3 == -num4 )
            {
                printf( "YES\n" );
                n--;
                goto loop;
            }
        }
        printf( "NO\n" );
        n--;
    }
}
