#include <bits/stdc++.h>

using namespace std;

#define EPS 1e-10
#define equals(a, b) (fabs(a - b) < EPS)

struct Point {
    double x, y;

    Point(){}
    Point(double x, double y) : x(x), y(y) {}
 
    Point operator - (const Point &p) const {  return Point(x - p.x, y - p.y); }
};

typedef Point Vector;

double cross(const Point &a, const Point &b)
{
    return a.x * b.y - b.x * a.y;
}

struct Line {
    Point s, t;
    Line(){}
    Line(Point s, Point t) : s(s), t(t) {}
};

bool isParallelSS(const Line &s1, const Line &s2)
{
    Vector a = s1.t - s1.s;
    Vector b = s2.t - s2.s;
    return equals(cross(a, b), 0);
}

istream &operator >> (istream &is, Point &p)
{
    return is >> p.x >> p.y;
}

int main()
{
    int N;
    Line l[2];
    cin >> N;
    while (N--) {
        for (int i = 0; i < 2; i++) {
            cin >> l[i].s >> l[i].t;
        }
        cout << (isParallelSS(l[0], l[1]) ? "YES" : "NO") << endl;
    }
    return 0;
}