t = int(input())

for i in range(t):
	a,b,c,d = map(int,input().split())
	e =[]
	if a >= b:
		a = a%b
		a += b
	if d >= b:
		d = d%b
		d += b
	while True:
		f = a-b
		if f < 0:
			print('No')
			break
		elif f in e:
			print('Yes')
			break
		else:
			e.append(f)
			if f <= c:
				a = f+d
			else:
				a = f