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

import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {


    public static void main(String[] args)throws IOException{
        Scanner in=new Scanner(System.in);
        //
        int n=in.nextInt();
        String str=in.next();
        for(int i=1;i<n;i++){
            //
            if(str.charAt(i-1)>str.charAt(i)){
                //
                System.out.println("Yes\n"+(i-1)+" "+(i+1));
                return;
            }
        }
        System.out.println("NO");
    }

}
//
class Reader{
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input){
        reader=new BufferedReader(new InputStreamReader(input));
        tokenizer=new StringTokenizer("");
    }
    //
    static String next()throws IOException{
        while(!tokenizer.hasMoreTokens()){
            tokenizer=new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
    //
    static int nextInt() throws IOException {return Integer.parseInt(next());}
    static double nextDouble()throws IOException{return Double.parseDouble(next());}
}
