#include <cstdio>

using namespace std;

int n;
double x[4],y[4];

int main()
 {
	
scanf("%d",&n);
	
for (int c = 0; c < n; c++)
{
		
for(inti = 0; i < 4; i++)scanf("%lf%lf",&x[i],&y[i]);
		
puts((y[1]-y[0])/(x[1]-x[0]) == (y[3]-y[2])/(x[3]-x[2])?"YES":"NO");
	
}
 }