a = int(input())
c = []
for i in range(a):
	b = list(map(int,input().split()))
	if ((b[0] % b[1] == 0 and b[1] <= b[2]) and b[1] != 1 )or b[0] < b[1]:
		print("No")
	else:
		pp = b[0] % b[1]
		while(1):
			if pp  < 0:
				print("No")
				break
			elif pp in c:
				print("Yes")
				break
			else:
				c.append(pp)
			if pp <= b[2]:
				pp += b[3]
			pp %= b[1]
			if pp < b[1] and b[2] < pp:
				print("No")
				break

		
	c = []
