test_cases = input()

for test_case in range(test_cases):
	A, B, C, D = map(int, raw_input().split(' '))

	last_take = max(1, (A - C + B - 1) / B)
	A -= last_take * B

	if B <= D and A >= 0:
		printed = False

		if B == D:
			print "Yes"
			printed = True

		if printed is False:
			for i in range(10000):
				x = (C - A) / (D - B) + 1
				A += (D - B) * x
				last_take = max(1, (A - C + B - 1) / B)
				A -= last_take * B
				
				if A < 0:
					print "No"
					printed = True
					break
			
		#you're doing jumps with size D - B
		if printed is False:
			print "Yes"
	else:
		print "No"
