#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;
    cin >> n;
    rep(j, n)
    {
        double a[8];
        rep(i, 8)
        {
            cin >> a[i];
        }
        double ans = (a[2] - a[0]) * (a[7] - a[5]) - (a[3] - a[1]) * (a[6] - a[4]);
        if (ans < 0.0000001)
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
    return 0;
}