t = int(input())

def sub(a, b, c, d):
	values = [a]
	i = a
	while (True):
		i = i % b if i > b else i - b
		if i < 0:
			return 'No'
		if i <= c:
			i += d
		if i in values:
			return 'Yes'
		values.append(i)
	return 'No'

def main():
	for i in range(0, t):
		a, b, c, d = map(int, input().split(' '))
		print(sub(a, b, c, d))

main()
