import math

n = int(input())
a = [0]*n
for i in range(n):
	a[i] = list(map(int, input().split()))

for i in range(n):
	A, B, C, D = a[i]
	if D < B:
		print('No')
		continue
	if A < B:
		print('No')
		continue
	if B - C < 2 and B - C >= 0:
		print('Yes')
		continue

	f = False
	A = A % B
	if A < C:
		A += B*math.floor(C/B)

	D = D % B
	if D < C:
		D += B*math.floor(C/B)

	init = A
	while True:
		if A <= C:
			A += D
		else:
			A -= B

		if A < 0:
			print('No')
			break

		if init == A:
			print('Yes')
			break