#include <cstdio>
#include <iostream>
using namespace std ;

int main()
{
	int n,i ;
	cin >> n ;

	double ax,ay,bx,by,cx,cy,dx,dy,a,b ;

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

		a = (ay-by)/(ax-bx) ;
		b = (cy-dy)/(cx-dx) ;

		if( a == b )
		{
			cout << "YES" << endl ;
		}
		else
		{
			cout << "NO" << endl ;
		}
	}
	return 0 ;
}