#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 x1,y1,x2,y2,x3,y3,x4,y4;
        cin >> x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
        vec a(x1-x2, y1-y2);
        vec b(x3-x4, y3-y4);
        double x = cross(a,b);
        if(abs(x)<1e-7){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}