import sys
input = sys.stdin.readline
N = int(input())
def modrep(x, b, count, c, d):
  for _ in range(count):
    g = x % b
    if g > c:
      return False
    if x < b:
      return False
    x = g + d
  return True
for _ in range(N):
  a, b, c, d = map(int, input().split())
  g = (c // b) * b
  if a < b:
    print("No")
    continue
  if g == 0 and (a % b):
    print("No")
    continue
  if modrep(g + d, b, 10000, c, d) == False:
    print("No")
    continue
  print("Yes")