a=input()
s=input()
r=0
flag=0
for i in range(len(s)):
    if(i==0):
        r=ord(s[i])
    else:
        if(ord(s[i])>=r):
            r=ord(s[i])
            continue;
        else:
            print('YES')
            print(i,i+1)
            flag=1
            break;
if(flag==0):
    print('NO')
            
            
            
                
        
