//package talas.edu.codeforces.com;

import java.util.Scanner;

public class MyApplication {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        String s = scanner.next();

        int focalIndexMin = -1;
        int focalIndexMax = n - 1;

        char minC = s.charAt(0), maxC = s.charAt(0);
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) < minC) {
                minC = s.charAt(i);
                focalIndexMin = i;
            }
            if (s.charAt(i) >= maxC) {
                maxC = s.charAt(i);
                focalIndexMax = i;
            }
        }
        if (focalIndexMin != -1) {
            System.out.println("YES");
            int m = focalIndexMin;
            while (s.charAt(m) == s.charAt(focalIndexMin)) {
                m--;
            }
            System.out.println(String.format("%d %d", m + 1, focalIndexMin + 1));
        } else if (focalIndexMax != n - 1) {
            int m = focalIndexMax;
            while (s.charAt(m) == s.charAt(focalIndexMax)) {
                m++;
            }
            System.out.println("YES");
            System.out.println(String.format("%d %d", focalIndexMax + 1, m + 1));
        } else {
            System.out.println("NO");
        }
    }
}
