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

public class Main
{
	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tok = new StringTokenizer("");
    String next() throws IOException {
        if (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); }
        return tok.nextToken();
    }
    int nextInt() throws IOException { return Integer.parseInt(next()); }
    long nextLong() throws IOException { return Long.parseLong(next()); }
    
    void solve() throws IOException {
        int N = nextInt();
        char[] S = next().toCharArray();
        boolean F=false;
        int st=0;
        char A='a';
        E:
        for (int n=0;n<N-1;n++) {
            
            if (S[n]>A) { A=S[n]; st=n; continue; } 
            if (S[n]<A) {       
                    System.out.println("YES");
                    System.out.printf("%d %d%n",st+1,n+1);
                    F=true;
                    break; 
            }
        }
        if (!F) System.out.println("NO");
    }
    
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }
}