def main():
  t = int(input())
  for _ in range(t):
    a, b, c, d = map(int, input().split())
    if (a < b or d < b):
      print("No")
      continue
    if (c >= b - 1):
      print("Yes")
      continue
  
    a %= b
    if a > c:
      print("No")
      continue
    d %= b
    if d == 0:
      print("Yes")
      continue
    if b % d != 0:
      print("No")
      continue
    for i in range(b // d):
      a = (a + d) % b
      if a > c:
        print("No")
        break
    else:
      print("Yes")
main()