#include <iostream>

using namespace std;

int main()
{
	double xa, ya, xb, yb, xc, yc, xd, yd;
	double AB, CD;
	int num = 0, i = 0;

	cin >> num;
	while ( i < num )
	{
		cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd;
		AB = ( ya - yb ) / ( xa - xb );
		CD = ( yc - yd ) / ( xc - xd );
		if ( AB == CD )
		{
			cout << "YES" << endl;
		}
		else if ( AB != CD )
		{
			cout << "NO" << endl;
		}

		i = i + 1;
	}

	return 0;
}