/* Codeforces Round 549 */
import javax.swing.plaf.metal.MetalTabbedPaneUI;
import java.io.*;
import java.util.*;

   public class A {

    BufferedWriter write=new BufferedWriter(new OutputStreamWriter(System.out));
    //PrintWriter pr=new PrintWriter(System.out);
    Scanner stdin=new Scanner(new BufferedInputStream(System.in));
    void run()  throws Exception {

        FastReader scan = new FastReader();
        int n = scan.nextInt();
        String s=scan.next();

        String t="";
        int l=0,r=n-2;
        while (l<r){
            if (s.charAt(l)>s.charAt(l+1)){
                while (r!=l){
                    if(s.charAt(r)<s.charAt(l)){
                        System.out.println("YES");
                        System.out.println((l+1)+" "+(r+1));
                        System.exit(0);
                    }
                    r--;
                }
            }
            l++;
        }
        System.out.println("NO");

            //System.out.println("NO");

    }
    public static void main(String[] args) throws Exception {
        new A().run();
    }
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}

