#include <iostream>
using namespace std;

int main()
{
	int n,d1,d2;
	double x[4], y[4];
	int ans[100];
	cin >> n;
	for (int a = 0; a < n; a++) {
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
		if (x[0] > x[2])
			d1 = x[0] - x[2];
		else
			d1 = x[2] - x[0];
		if (x[1] > x[3])
			d2 = x[1] - x[3];
		else
			d2 = x[3] - x[1];
		if (d1 == d2)
			ans[a] = 0;
		else
			ans[a] = 1;
	}
	for (int b = 0; b < n; b++) {
		if (ans[b] == 0)
			cout << "YES" << endl;
		else if (ans[b] == 1)
			cout << "NO" << endl;

	}
}