#include <bits/stdc++.h>
using namespace std;
typedef complex<double> xy_t; 
xy_t a, b, c, d;
double x, y;
int n;
int main()
{
	cin >> n;
	for(int i=0; i<n; i++)
	{
		cin >> x >> y;
		a=xy_t(x, y);
		cin >> x >> y;
		b=xy_t(x, y);
		cin >> x >> y;
		c=xy_t(x, y);
		cin >> x >> y;
		d=xy_t(x, y);
		if((conj(b-a)*(d-c)).imag()==0)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
	return 0;
}