import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        String s = scanner.next();


        if (s.chars().sum() / s.length() != s.charAt(0)) {
            for (int i = 0; i < s.length(); i++) {
                for (int j = i + 1; j < s.length(); j++) {
                    char[] c = s.substring(i, j).toCharArray();
                    reverse(c);
                    String res = s.substring(0, i) + String.valueOf(c) + s.substring(j);
                    if (res.compareTo(s) < 0) {
                        System.out.println("YES");
                        System.out.println((i + 1) + " " + (j));
                        return;
                    }
                }
            }
        }

        System.out.println("NO");
    }


    public static void reverse(char[] c) {
        for (int i = c.length - 1, j = 0; i > j; i--, j++) {
            char temp = c[j];
            c[j] = c[i];
            c[i] = temp;
        }
    }
}
