#include <bits/stdc++.h>
using namespace std;

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

int main()
{
    int n;
    pair<double, double> pa;
    vector<pair<double, double> > a;
    vector<pair<double, double> > b;
    cin >> n;
    rep(j, n)
    {
        rep(i, 2)
        {
            cin >> pa.first;
            cin >> pa.second;
            a.push_back(pa);
        }
        rep(i, 2)
        {
            cin >> pa.first;
            cin >> pa.second;
            b.push_back(pa);
        }
        SORT(a);
        SORT(b);
        double anglea = (a[1].second - a[0].second)*(b[1].first - b[0].first);
        double angleb = (b[1].second - b[0].second)*(a[1].first - a[0].first);
        if(DEBUG) cout<<anglea<<" "<<angleb<<endl;
        if (anglea==angleb)
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
        a.clear();
        b.clear();
    }
    return 0;
}