import java.util.Scanner;
public class Substring {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        char[] input = scanner.nextLine().toLowerCase().toCharArray();
        for(int i = 1; i < n; i++){
            char current = input[i];
            for(int j = i+1; j < n-1; j++){
                if(current < input[j]) {
                    System.out.println("YES");
                    System.out.printf("%d %d", i, j);
                    return;
                }
            }
        }
        System.out.println("NO");

    }
}
