n=int(input())
s=input()
chk=False
cur=s[0]
l,r=1,1
for i in range(1,n):
  if s[i]>=cur:
    cur=s[i]
    l=i+1
  else:
    chk=True
    r=i+1
    break
if chk:
  print("YES")
  print(l,r)
else:
  print("NO")


