import java.io.*;
import java.util.*;
import java.lang.*;

public class Sol {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = Integer.parseInt(br.readLine());
        char[] ca = br.readLine().toCharArray();
        boolean flag = false;
        for (int i = 0; i < --n; i++) {
            if (ca[i] > ca[i+1] && !flag) {out.printf("YES%n%d %d", i+1, i+2); flag = true;}
        }
        if (!flag) out.println("NO");
        out.close();
    }
}