T = int(input())
for i in range(T):
	A, B, C, D = list(map(int, input().split()))
	memo = set()
	x = A
	while True:
		x -= B
		if x < 0:
			print("No")			
			break 
		x -= B*(x // B)
		if x <= C:
			x += D
		if x in memo:
			print("Yes")
			break
		memo.add(x)

