import java.util.Scanner;

public class TrainingsTest{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        char[]s=new char[in.nextInt()];
        in.nextLine();
        s=in.nextLine().toCharArray();
        int l=0,r=0;
        for(int i=0;i<s.length-1;i++){
            if(s[i]>s[i+1]){
                l=i;
                r=i+1;
                break;
            }
        }
        System.out.println(r!=0?"YES\n"+l+" "+r:"NO");
    }
}