def gcd (a,b):
	if a < b:
		a,b = b,a
	return a if b == 0 else gcd(b,a%b)

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 % B) > C:
		print("No")
		continue

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

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

	c = (C // dif)
	#print(B//dif,C // dif)
	if (C % dif) == 0:
		if (B - C) <= dif:
			print("Yes")
		else:
			print("No")
	else:
		if ((B-1)//dif) - (C//dif) >= 1:
			print("No")
		else:
			print("Yes")
