from fractions import gcd
n = int(raw_input())
lim = 10**19
for i in xrange(n):
	a, b, c, d = map(int, raw_input().split())
	if a < b or d < b:
		print 'No'
	else:
		# c - b + 1
		e = c - b + 1
		g = gcd(b, d)
		dist = abs(a % g) - abs(e % g) + g
		dist %= g
		e += dist
		if e < 0 or e > c - b + d:
			print 'No'
		else:
			print 'Yes'
