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();
        jopa a[] = new jopa[26];
        Arrays.fill(a,new jopa(-1,-1));
        for (int i = 0; i < n; i++) {
            if(a[s.charAt(i) - 'a'].fst == -1)a[s.charAt(i) - 'a'].fst = i;
            a[s.charAt(i) - 'a'].sec = i;
        }
        for (int i = 0; i < 26; i++) {
            for (int j = i+1; j < 26; j++) {
                if(a[j].fst < a[i].sec && a[j].fst != -1){
                    System.out.println("YES");
                    System.out.print((a[j].fst + 1) + " " + (a[i].sec + 1));
                    return;
                }
            }
        }
        System.out.println("NO");
    }
}
class jopa{
    int fst, sec;

    public jopa(int fst, int sec) {
        this.fst = fst;
        this.sec = sec;
    }
}