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 min = s.charAt(0);
        for (int i = 1; i < n; i++) {
            if (min > s.charAt(i)) {
                min = s.charAt(i);
                l = i+1;
            } else {
                r = i+1;
                if (l != -1) {
                    break;
                }
            }
        }
        if (r!=-1) {
            System.out.println("YES");
            System.out.println((l) + " " + (r));
        } else {
            System.out.println("NO");
        }
    }
}
