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();

        for (int i = 0; i < s.length(); i++) {
            if (i + 1 < s.length() && s.charAt(i) > s.charAt(i + 1)) {
                System.out.println("YES");
                System.out.println(i + " " + (i + 1));
                return;
            }
        }
        System.out.println("NO");
    }

}
