for _ in range(int(input())):
  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)

  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")
