t = int(input())
for _ in range(t):
  a, b, c, d = map(int, input().split())
  zaiko = a
  rereki = [False] * 10 ** 20
  while True:
    zaiko -= b
    if zaiko < 0:
      ans = 'No'
      break
    if zaiko <= c:
      zaiko += d
    if rereki[zaiko]:
      ans = 'Yes'
      break
    rereki[zaiko] = True
  print(ans)
