n=int(input())
s=list(input())
if(s==sorted(s)):
    print("NO")
else:
    flag=0
    x=sorted(s)
    for i in range(n):
        if(ord(s[i])>ord(x[i])):
            x=i
            break
    for i in range(x,n):
        if(ord(s[i])<ord(s[x])):
            y=i
            break
    print("YES")
    print(x+1,y+1)