import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class test {

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int len = Integer.parseInt(reader.readLine());
        String str = reader.readLine();

        for (int i = 0; i < len; i++) {
            char c = str.charAt(i);
            for (int j = i + 1; j < len; j++) {
                if (str.charAt(j) < str.charAt(i)) {
                    System.out.println("YES");
                    System.out.println(i + " " + j);
                    System.exit(0);
                }
            }
        }

        System.out.println("NO");
    }

}