import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String s = in.next();
        char[] c = s.toCharArray();
        boolean is = false;
        int i = 0, j = 0;
        o:
        for (; i < n; i++) {
            if (c[i] == 'a') continue;
            for (j = i + 1; j < n; j++) {
                if (c[i] > c[j]) {
                    is = true;
                    break o;
                }
            }
        }
        System.out.println(is ? "YES\n" + i + " " + j : "NO");
    }
}