from fractions import gcd
T=input()
def check(a,b,c,d):
	a-=b
	if a<0: return 0
	if d<b: return 0
	if d>=b:
		if c>=b-1: return 1
		else:
			d=gcd(b,d)
			a%=d
			l=c+d-a
			r=b+d-a-1
#			print l,r,d
			if l/d<r/d:
				return 0
			else:
				return 1
			# l<=a + t * d<=r
for i in xrange(T):
	a,b,c,d=map(int,raw_input().split())
	if check(a,b,c,d):
		print "Yes"
	else:
		print "No"