import java.util.*;

public class d {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int l = -1;
        int r = -1;
        int count = 0;
        for (int i = 0; i < s.length() - 1; i++) {
            if (s.charAt(i) <= s.charAt(i + 1)) {
                count++;
            }
        }
        if (count == s.length() - 1) {
            System.out.println("NO");
            System.exit(0);
        }
        for (int i = 0; i < s.length() - 1; i++) {
            for (int j = i + 1; j < s.length(); j++) {
                if (s.charAt(j) < s.charAt(i)) {
                    l = i;
                    r = j;
                    break;
                }
            }
        }
        System.out.println("YES");
        System.out.println(l + " " + r);
    }
}
