import fractions

def func(A,B,C,D):
#	print "A,B,C,D::",A,B,C,D

	if A<B:
		print "No"
	elif B>D:
		print "No"
	elif B<=C:
		print "Yes"

	else:
		A%=B
		g=fractions.gcd(B,D)
		if g==B:
			if A>C:
				print "No"
			else:
				print "Yes"
		elif B-g>C:
			print "No"
		else:
			print "Yes"
T=input()

for i in range(T):
	a,b,c,d=map(int, raw_input().split())
	func(a,b,c,d)

