n=int(input())
s=list(input())
flag=0
for i in range(n-1):
    if(s[i]>s[i+1]):
        print('YES')
        print(i+1,end=" ")
        print(i+2)
        flag=1
        break
if(flag==0):
    print('NO\n')
