t = int(input())
a = []
for i in range(t):
	a.append(input().split())
	for j in range(4):
		a[i][j] = int(a[i][j])

def kou(x, y):
	if y > x:
		z = y
		y = x
		x = z
	while x % y != 0:
		x, y = y, x % y
	return y

def function(arr):
	if arr[0] < arr[1]:
		print('No')
	elif arr[1] - arr[2] <= 1:
		print('Yes')
	else:
		count = 0
		s = kou(arr[1], arr[3])
		for i in range(arr[2] + 1, arr[1]):
			if (arr[0] - i) % s == 0:
				count = 1

		if count == 1:
			print('No')
		else:
			print('Yes')

for i in range(t):
	function(a[i])