t = int(input())
a = []
for i in range(t):
  a.append(list(map(int,input().split())))
for j in a:
  b = j[0]
  for k in range(j[1]):
    if j[0] < j[1]:
      print("No")
      break
    j[0] %= j[1]
    if j[0] <= j[2]:
      j[0] += j[3]
    else:
      print("No")
      break
    if j[0] < j[1]:
      print("No")
      break
    if k == j[1]-1:
      print("Yes")
    