def gcd(x, y):
	while y:
		x, y = x, x % y
	return x

t = int(input())
a = []
d = 0
for i in range(t):
  a.append(list(map(int,input().split())))
for j in a:
  if j[0] < j[1] or j[1] > j[3]:
    print("No")
  else:
    b = j[0] % j[1]
    k = gcd(j[1],j[3])
    c = j[2] % k
    if b > c:
      d = j[2] + k + c - b
    else:
      d = j[2] + c - b
    if b > d:
      print("No")
    else:
      print("Yes")
    
    
    