T = int(input())
for _ in range(T):
  a,b,c,d = [int(_) for _ in input().split()]

  result = a-b  # 2
  while result >= 0:
    if result <= c:
      result += d
    result = result -b
    if result == (a-b):
      break
  if result < 0:
    print("No")
  elif result == (a-b):
    print("Yes")