#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;


#define rep(i,n) for(int i=0;i<(n);i++)

const double EPS = 1e-6;
const double INF = 100000000;

bool solve(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
    double ax,ay,bx,by;
    ax=x2-x1;ay=y2-y1;
    bx=x4-x3;by=y4-y3;
    double A=ay/ax;
    double B=by/bx;
    
    
    if(A-B < EPS)return true;
    else return false;
    
}



int main(){
    int n;
    cin>>n;
    rep(i,n){
        double x1, y1, x2, y2, x3, y3, x4, y4;
        cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
        cout<<(solve(x1, y1, x2, y2, x3, y3, x4, y4)? "YES":"NO")<<endl;
        
    }

    return 0;
}