a=int(input())
s=input()
ans=[]
for i in range(len(s)):
    ans.append(ord(s[i])-97)
if(ans==sorted(ans)):
    print('NO')
else:
    index=0
    import math
    maxa=ans[0]
    save=0
    for i in range(1,len(ans)):
        if(ans[i]>maxa):
            maxa=ans[i]
            save=i
        elif(ans[i]<maxa):
            print('YES')
            print(save+1,i+1)
            exit()
            
    
