n=int(input())
s=input()
ss=sorted(s); f=0; i=0
while i<n:
    if s[i]!=ss[i]: f=1; break
    i+=1
if f:
    j=i+1
    while j<n:
        if ss[i]==s[j]: break
        j+=1
    print("YES", i+1, j+1)
else: print("NO")