#include<iostream>

using namespace std;

bool get_inc( double x1 , double y1 , double x2 , double y2 , double& a );

int main(void)
{
	double x1, x2, x3, x4;
	double y1, y2, y3, y4;

	double a1, a2;

	int n;

	cin >> n;

	for( int i = 0 ; i < n ; i++ )
	{
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

		bool result1 = get_inc( x1 , y1 , x2 , y2 , a1 );
		bool result2 = get_inc( x3 , y3 , x4 , y4 , a2 );

		if( result1 == false && result2 == false )
		{
			cout << "YES" << endl;
		}
		else
		{
			if( a1 - a2 == 0 ) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
	}


	return 0;
}

bool get_inc( double x1 , double y1 , double x2 , double y2 , double& a )
{
	a = ( y2 - y1 )/( x2 - x1 );
	if( x2 - x1 >= -0.0000001 && x2 - x1 <= 0.0000001 )
	{
		return false;
	}
	return true;
}