#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define rep(i,n) REP(i, 0, n)
typedef complex<double> Point;
double cross(const Point& a, const Point& b){
    return (conj(a) * b).imag();
}
int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    Point a[4];
    int N; cin >> N;
    rep(casenum, N){
        double x_, y_;
        rep(i, 4) {
            cin >> x_ >> y_;
            a[i] = Point(x_, y_);
        }
        if([](Point a, Point b){
            double sum = cross(a, b) / 2;
            return sum < 1.0e-11;
        }(a[1] - a[0], a[3] - a[2]))cout << "YES"; else cout << "NO";
        cout << endl;
    }
    return 0;
}