#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

int N;
string bn;
	
	cin >> N;
	vector< vector<double> > s(N,vector<double>(8,0));
	
	rep(i,N) rep(j,8) cin >> s[i][j];
	rep(i,N){
		double e1=0, e2=0;
		if(s[i][2] != s[i][0]) e1 = (s[i][3]-s[i][1])/(s[i][2]-s[i][0]);
		if(s[i][6] != s[i][4]) e2 = (s[i][7]-s[i][5])/(s[i][6]-s[i][4]);
//		printf("%f %f",e1,e2);
		if(e1 == e2 ) cout << "YES\n";
		else cout << "NO\n";
	}
	return 0;
}