n=int(input())
s=input()
l=[i for i in s]
l.sort()
poss=0
left=0
right=0
for i in range(n):
    if(l[i]==s[i]):
        continue
    poss=1
    left=i+1
    for j in range(i+1,n):
        if(s[j]==l[i]):
            right=j+1
    break
if(poss):
    print("YES")
    print(left,right)
else:
    print("NO")
