# -*- coding: utf-8 -*-
import sys
def fi():
    return int(sys.stdin.readline())

def fi2():
    return map(int, sys.stdin.readline().split())

def fi3():
    return sys.stdin.readline()

def fo(*args):
    for s in args:
        sys.stdout.write(str(s)+' ')
    sys.stdout.write('\n')

INF=10**9+7
sys.setrecursionlimit(INF)

#main
n=fi()
s=raw_input()
l=-1
r=-1
for i in range(len(s)-1):
    if ord(s[i])>ord(s[i+1]):
        l=i+1
        r=i+2
        break

if l==-1 and r==-1:
    fo("NO")
else:
    fo("YES")
    fo(str(l)+" "+str(r))
        
            
                
            
            
 
    


    

    
        
            
            
            
    
    
    
    
    
    


    


    
            
        
    
    
        
        
    
    
    
        
        
        

 




        
        
        
        

 



