def check(a,b,c,d):
	if a < b:
		print('No')
		return True
	if d < b:
		print('No')
		return True
	return False

T = int(input())
query = []
for i in range(T):
	query.append(list(map(int, input().split())))

for q in query:
	flg = True
	a = q[0]
	b = q[1]
	c = q[2]
	d = q[3]

	if check(a,b,c,d):
		continue

	if a % b > c % b:
		p = a % b + (c % b) * b
	else:
		p = a % b + (c % b - 1) * b

	if d % b > c % b:
		r = d % b + (c % b) * b
	else:
		r = d % b + (c % b - 1) * b

	for i in range(b):
		if (p + i*r) % b > c:
			print('No')
			flg = False
			break
	if flg:
		print('Yes')
