a='abcdefghijklmnopqrstuvwxyz'
n=int(input())
s=list(input())
if s[0]==s[1]==s[2]==s[3]:
    print('NO')
elif s==sorted(s):
    print('NO')
else:
    f=0
    print('YES')
    for i in range(0,n):
        for j in range(i+1,n):
            if a.index(s[i])>a.index(s[j]) :
                print(i+1,j+1)
                f=1
                break
        if f==1:
            break
    
