#include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define sort(ss) sort(ss.begin(), ss.end())
#define rsort(ss) sort(ss.rbegin(), ss.rend())
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return acos(-1.0);
}
typedef set<int> set_i;
typedef set<string> set_s;
int INF=1000000;
int main(){
	int n,ans;
	double x1,x2,x3,x4,y1,y2,y3,y4;
	double ab,cd;
	cin>>n;
	ans=0;
	for(int i=0;i<n;i++){
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		if(x1-x2!=0.0) ab=(y1-y2)/(x1-x2);
		else ab=INF;
		if(x3-x4!=0) cd=(y3-y4)/(x3-x4);
		else cd=INF;
		if(ab==cd) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}