#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;

struct point {
    double x;
    double y;
};

double vectorproduct(point p1, point p2)
{
    return p1.x * p2.y + p1.y * p2.x;
    
}

int main()
{
    int n;
    double x1, y1, x2, y2, x3, y3, x4, y4;
    point p1, p2;
    cin >> n;
    for(int c=0; c< n; c++)
    {
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
        p1.x = x2 - x1;
        p2.x = x4 - x3;
        p1.y = y2 - y1;
        p2.y = y4 - y3;
        if(vectorproduct(p1, p2)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return EXIT_SUCCESS;
}