import java.util.*;

public class Solver{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String s = in.next();
        int a[] = new int[26];
        for (int i = 0; i < n; i++) {
            a[s.charAt(i) - 'a'] = i;
        }
        for (int i = 0; i < 26; i++) {
            for (int j = i+1; j < 26; j++) {
                if(a[j] < a[i] && a[j] != 0){
                    System.out.println("YES");
                    System.out.print((a[j]+1) + " " + (a[i]+1));
                    return;
                }
            }
        }
        System.out.println("NO");
    }
}