#include<string>
#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		double a[4][2];
		for (int I = 0; I< 4; I++)
		{
			for (int k = 0; k < 2; k++)
			{
				cin >> a[I][k];
			}
		}
		double x, y;
		x = (a[1][0] - a[0][0]);
		y = (a[3][0] - a[2][0]);
		x = (x) ? (a[1][1] - a[0][1]) / x : 0;
		y = (y) ? (a[3][1] - a[2][1]) / y : 0;
		if (x == y)cout << "YES" << endl;
		else cout << "NO" << endl;
	}

}
/*
		x = (a[1][1] - a[0][1]) / (a[1][0] - a[0][0]);
		y = (a[3][1] - a[2][1]) / (a[3][0] - a[2][0]);*/