#include <iostream>
using namespace std ;

int main()
{
	int num ;
	float ax, ay, bx, by, cx, cy, dx, dy ;

	cin >> num ;
	for( int i = 0 ; i < num ; i ++ )
	{
		cin >> ax >> ay >> bx >> by >> cx >> cy >> dx >> dy ;

		if( (ay-by)/(ax-by) == (cy-dy)/(cx-dx) )
		{
			if( ax != cx && bx != dx && ay != cy && by != dy )
			{
				cout << "YES\n" ;
			}
		}
		else cout << "NO\n" ;
	}
	return 0;
}