import math
t = int(input())
for i in range(t):
  a,b,c,d = [int(x) for x in input().split()]
  if a < b or b > d:
    print("No")
    continue
  elif b == d:
    if a%b <= c:
      print("Yes")
    else:
      print("No")
    continue
  else:
    if b <= c:
      print("Yes")
      continue
    else:
      l =[]
      tmp = a
      while True:
        payoff = tmp % b + math.ceil(c/b)*b-b
        if payoff > c:
          print("No")
          break
        if payoff in l:
          print("Yes")
          break
        else:
          l.append(payoff)
        tmp = payoff + d