try:
    l=int(input())
    s=input()
    
    c=0
    for i in range(0,l-1):
        if(s[i+1]<s[i]):
            a=i
            b=i+1
            c=1
            break
        
        
            
    if(c==1):
        print("YES")
        print(a+1,b+1,end="")
    else:
        print("NO")
except:
    pass
    
            
