N = int(input())
x = []
for i in range(N):
    a1,b1,c1,d1=[int(i) for i in input().split()]
    x.append([a1,b1,c1,d1])
for i in range(N):
  y = x[i]
  if y[0] < y[1]:
    print("No")
  elif y[1] > y[3]:
    print("No")
  elif y[1] > y[2]:
    ama = y[0] % y[1]
    mita = set()
    while True:
      if ama in mita:
        print("Yes")
        break
      mita.add(ama)
      if ama <= y[2] and ama>= 0:
        ama += y[3]
      if ama < y[1]:
        print("No")
        break
      ama %= y[1]
  else:
    print("Yes")