#include <stdio.h>
 
struct point {
    double x;
    double y;
};
 
int main(void) 
{
    int i, n;
    struct point A, B, C, D;
    double slope_AB, slope_CD;
 
    scanf("%d", &n);
 
    for (i = 0; i < n; i++) {
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &A.x, &A.y, &B.x, &B.y, &C.x, &C.y, &D.x, &D.y);
 
        slope_AB = (A.y - B.y) / (A.x - B.x);
        slope_CD = (C.y - D.y) / (C.x - D.x);
 
        if (slope_AB == slope_CD) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}