#include <iostream>
#include<cmath>
#include<iomanip>
#include<stdio.h>
#include<memory.h>
using namespace std;

int main()
{
	int n;
	while (cin >> n)
	{
		double **a = new double*[n];
		char **b = new char*[n];
		for (int i = 0; i < n; i++)
		{
			a[i] = new double[8];
			b[i] = new char[4];
			memset(a[i], 0, sizeof(a[i]));
			memset(b[i], 0, sizeof(b[i]));
		}
		for (int i = 0; i < n; i++)
			for (int j = 0; j < 8; j++)
				cin >> a[i][j];
		for (int i = 0; i < n; i++)
			if (fabs(a[i][0] - a[i][2]) < 10e-3 || fabs(a[i][4] - a[i][6]) < 10e-3)
				if (fabs(a[i][0] - a[i][2]) < 10e-3 && fabs(a[i][4] - a[i][6]) < 10e-3)
					b[i][0] = 'Y', b[i][1] = 'E', b[i][2] = 'S';
				else
					b[i][0] = 'N', b[i][1] = 'O';
			else
				if(fabs((a[i][3]-a[i][1])/(a[i][2]-a[i][0])-(a[i][7]-a[i][5])/(a[i][6]-a[i][4]))<10e-3)
					b[i][0] = 'Y', b[i][1] = 'E', b[i][2] = 'S';
				else
					b[i][0] = 'N', b[i][1] = 'O';
		for (int i = 0; i < n; i++)
			cout << b[i] << endl;
		for (int i = 0; i < n; i++)
			delete a[i], b[i];
		delete a, b;
	}
	return 0;
}
