//package sixty_three;

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

public class A {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(input.readLine());
        int N = Integer.parseInt(st.nextToken());
        String f = input.readLine();
        for (int i = 0; i < N; i++){
            for (int j = i+2; j <= N; j++){
                if ((f.substring(0, i)+new StringBuilder(f.substring(i, j)).reverse().toString()+f.substring(j)).compareTo(f) < 0){
                    System.out.println("YES");
                    System.out.println(i+" "+j);
//                    System.out.println(f.substring(0, i)+new StringBuilder(f.substring(i, j)).reverse().toString()+f.substring(j));
                    System.exit(0);
                }
            }
        }
        System.out.println("NO");
//      BufferedReader input = new BufferedReader(new FileReader("A.in"));
//      PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("A.out")));   

    }
}
