#include <iostream>
#include <string>
#include <cctype>
#include <vector>
#include <complex>

using namespace std;

#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)

typedef vector<int> vi;
typedef long long ll;
typedef complex<double> vec;

double cross(const vec& a, const vec& b) {
  return imag(conj(a)*b);
}

int main(){
    int n;
    cin >> n;
    rep(_,n){
        double q,w,e,r,t,y,u,i;
        cin >> q>>w>>e>>r>>t>>y>>u>>i;
        vec a(q-e, w-r);
        vec b(t-u, y-i);
        double x = cross(a,b);
        if(abs(x)<1e-9){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}