n=int(input())
s=input()
so = sorted(s)
sp = "". join(so)
if sp==s:
    print('NO')
else:
    print('YES')
    j=1
    while(True):
        if j==n-1:
            print
            ("1 2")
        
        elif s[n-j:n-j-2:-1] < s:
            print(n-j,n-j+1,end=" ")
            break
        else:
            j+=1
