import java.io.*;
import java.util.StringTokenizer;

public class SolverA {

    StringTokenizer stok;
    BufferedReader br;
    PrintWriter pw;

    String nextToken() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            stok = new StringTokenizer(br.readLine());
        }
        return stok.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private void run() throws IOException {
//        br = new BufferedReader(new FileReader("input.txt"));
//        pw = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        pw.flush();
        pw.close();
    }

    public static void main(String[] args) throws IOException {
        new SolverA().run();
    }

    private void solve() throws IOException {
        int n = nextInt();
        String str = nextToken();
        char[] mas = str.toCharArray();
        for(int start = 0; start < mas.length; start++){
            String tmpStr = str.substring(0, start);
            for(int end = start+1; end < mas.length; end++){
                tmpStr+= getSuffix(start, end, str);
                if(end < mas.length - 1) {
                    tmpStr += str.substring(end + 1, mas.length);
                }
                if(str.compareTo(new StringBuffer(tmpStr).reverse().toString()) > 0){
                    pw.println("YES");
                    pw.print(start+1);
                    pw.print(" ");
                    pw.print(end+1);
                    return;
                }
            }
        }

        pw.println("NO");
    }

    private String getSuffix(int start, int end, String str) {
        return new StringBuffer(str.substring(start, end+1)).reverse().toString();
    }
}