import std.stdio;

bool checkParallel(float a, float b, float c, float d){
	//x = c, y = cへの対応
	if(a == !c || b == !d)
		return false;
	if(!a && !c || !b && !d)
		return true;
	if(b / a == d / c)
		return true;
	return false;
}

void main(){
	int n;
	readf("%d\n", &n);
	while(n--){
		float x1, y1, x2, y2, x3, y3, x4, y4;
		readf("%f %f %f %f %f %f %f %f\n", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
		if(checkParallel(x1-x2, y1-y2, x3-x4, y3-y4))
			writeln("YES");
		else
			writeln("NO");
	}
}