import sys,math
from collections import defaultdict


n=int(input())
s=input()
maxchr='a'
maxindex=-1
ans='NO'
for i in range(n):
    if(s[i]>maxchr):
        maxchr=s[i]
        maxindex=i
    else:
        if(s[i]<maxchr):
            print('YES')
            print(maxindex+1,i+1)
            ans='YES'
            break
if(ans=='NO'):
    print('NO')
    
        
