import java.util.Scanner;
public class Sample {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        String str = sc.next();
        int c = 0,i = 1;
        int check = 97;
        int temp1= -1,temp2= -1;
        while(str.charAt(i) == str.charAt(i-1)) {
            check = str.charAt(i);
            i = i+1;
        }
        temp1 = i;
        for(int j = i; j < str.length(); j++) {
            int d1 = str.charAt(j);
            if(d1 <= check) {
                c = 1;
                temp2 = j;
                break;
            }
        }
        if(c == 1) {
            System.out.println("yes");
            System.out.println((temp1+1)+" "+(temp2+1));
        }
        else {
            System.out.println("no");
        }
    }
}