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