#include <iostream>

template <typename T>
struct Vector
{
    T x , y;

    auto operator - (Vector v) -> Vector
    {
        return Vector <T> {x - v.x , y - v.y};
    }
    auto cross (Vector v) -> T
    {
        return x * v.y - y * v.x;
    }
};

auto equal0 (double v) -> bool
{
    constexpr auto esp = 1e-10;
    return -esp < v && v < esp;
}

auto main () -> int
{
    int n;
    std::cin >> n;
    for (auto i = 0; i < n; ++ i)
    {
        Vector <double> A , B , C , D;
        std::cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y >> D.x >> D.y;
        auto AB = B - A;
        auto CD = D - C;
        auto d = AB.cross (CD);
        std::cout << (equal0 (d) ? "YES" : "NO") << std::endl;
    }
}