import math

for i in range(int(input())):
  # print(i)
  a, b, c, d = map(int, input().split())

  delta = d - b

  if delta < 0:
    print("No")
    continue

  b2 = b - c

  if a < b:
    print("No")
    continue

  if b2 <= 1:
    print("Yes")
    continue

  pos = ((a-c)%b)

  if delat == 0:
    if pos > 0 and pos < b2:
      print("No")
      continue
    else:
      print("Yes")
      continue

  gcd = math.gcd(b, delta)

  if gcd == 1:
    print("No")
    continue

  # print(pos,b,gcd)

  pos_mod = pos%gcd
  if pos_mod > 0 and pos_mod < b2:
    print("No")
    continue
  print("Yes")

  # s = set()
  # s.add(pos)


  # for _ in range(b):
  #   pos += delta
  #   pos = pos%b
  #   # print(pos)

  #   if pos > 0 and pos < b2:
  #     print("No")
  #     break

  #   # print(pos, delta)
  #   if pos in s:
  #     print("Yes")
  #     break

  #   s.add(pos)


  # else:
  #   print("Yes")
