from fractions import gcd

Q = int(input())
qs = []
for _ in range(Q):
	qs.append(list(map(int, input().split())))

for q in qs:
	a, b, c, d = q[0], q[1], q[2], q[3]
	if a < b or b > d:
		print("No")
	elif b == d:
		if a % b > c:
			print("No")
		else:
			print("Yes")
	else:
		if (c - a) % gcd(b, d) == 0:
			print("Yes")
		else:
			print("No")
