n=int(input())
s=input()
l=list(s) 
s1=sorted(l)
if l==s1:
   print("NO") 
else:
   for i in range(n-1):
      if l[i]>l[i+1]:
         le=i+1 
         lr=i+2 
         break 
      
   print("YES")
   print(le,end=" ")
   print(lr)