T = int(input())
for i in range(T):
	A, B, C, D = list(map(int, input().split()))
	if A < B:
		print("No")
	else:
		if D < B:
			print("No")
		else:
			if C >= B:
				print("Yes")
			else:
				x = A % B
				y = D % B
				z = B
				if y == 0:
					if x > C:
						print("No")
					else:
						print("Yes")

				else:
					if x > C:
						if (x - C) % y < z - C:
							print("No")
						else:
							print("Yes")
					else:
						if ((C - x) // y + 1) * y < z - x:
							print("No")
						else:
							print("Yes")

			