#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 dot(const Point &a, const Point &b)
{
    return a.x * b.x + a.y * b.y;
}
 
struct Line {
    Point s, t;
    Line(){}
    Line(Point s, Point t) : s(s), t(t) {}
}; 

bool isOrthogonalSS(const Line &s1, const Line &s2)
{
    Vector a = s1.t - s1.s;
    Vector b = s2.t - s2.s;
    return equals(dot(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 << (isOrthogonalSS(l[0], l[1]) ? "YES" : "NO") << endl;
    }
    return 0;
}