T = int(input())
for i in range(T):
	A,B,C,D = map(int,input().split(" "))
	if A < B:
		print("No")
		continue

	if D < B:
		print("No")
		continue

	if A > C:
		init = C + ((A - C) % B)
		if init != C:
			init -= B
		if init < 0:
			print("No")
			continue
	else:
		init = A

	if C >= (B-1):
		print("Yes")
		continue

	dif = (D - B)
	if dif == 0:
		print("Yes")
		continue

	i = init
	while True:
		k = C - ((C - i)%dif)
		if k + dif < B:
			print("No")
			break
		l = B - ((B - i)%dif)
		i = (l + dif)%B
		if (init - i) % dif == 0:
			print("Yes")
			break

	#print(B//dif,C // dif)
	
