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):
      print("Yes")
      continue
  
    lst = []
    d %= b
    while True:
      a %= b
      if a > c:
        print("No")
        break
      if a in lst:
        print("Yes")
        break
      lst.append(a)
      a += d
main()