Y = "Yes"
N = "No"
def solve(A,B,C,D):
	if A < B or B > D:
		return N
	elif B <= C:
		return Y
	else:
		if A > C:
			A -= ((A-C)//B)*B
			if A > C:
				A -= B
		if A < 0:
			return N
		x = D%B
		if x == 0:
			return Y
		y = (A+D)%B
		B-=y
		C-=y
		y = (B//x)*x
		if (y == B and B-x <= C) or y <= C:
			return Y
		else:
			return N
			
T = int(input())
for _ in range(T):
	A, B, C, D = [int(x) for x in input().split()]
	print(solve(A,B,C,D))
			