
import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
        String line = sc.nextLine();

        boolean found = false;
        for (int i = 0; i < n - 1; i++) {
            if (line.charAt(i) > line.charAt(i + 1)) {
                System.out.println("YES");
                System.out.println(i + " " + (i + 1));
                found = true;
                break;
            }
        }
        if (!found)
            System.out.println("NO");
        sc.close();

    }
}
