#include <iostream>
struct IVect2
{
    double x,y;
    IVect2(double _x, double _y)
    {
        x = _x;
        y = _y;
    }
};

bool isParallel(IVect2 a, IVect2 b)
{
    if(a.x == 0 || b.x == 0)
    {
        if(a.x == 0 && b.x == 0)
            return true;
        else
            return false;
    }
    
    if(a.y/a.x == b.y/b.x)
        return true;
    else
        return false;
}

int main()
{
    int n;
    std::cin >> n;
    for(int i=0; i<n; ++i)
    {
        double x1, y1, x2, y2, x3, y3, x4, y4;
        std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
        IVect2 a = IVect2(x2-x1, y2-y1);
        IVect2 b = IVect2(x4-x3, y4-y3);
        if(isParallel(a, b))
        {
            std::cout << "YES" << std::endl;
        }
        else
        {
            std::cout << "NO" << std::endl;
        }
    }
    
    return 0;
}