aa=int(input())
N=[0 for i in range(aa)]
for i in range(aa):
  bb=input()
  #print(b)
  N[i]=bb.split()


for i in range(aa):
  for j in range(4):
    N[i][j]=int(N[i][j])


for i in range(aa):

  a=N[i][0]
  b=N[i][1]
  c=N[i][2]
  d=N[i][3]

  e=a-a//b*b
  f=d-d//b*b
  

  h=0 #YES=0 NO=1
  if f!=0 :
    while e<b:
      if e>c :
        h=1
      e+=f
      #print(e)
      #print(f)
#print("while")
  else:
    if e>c :
      h=1
      e+=f

  if a<b:
    h=1

  if h==1:
    print("No")
  else:
    print("Yes")
