import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class ECF_rnd63_div2A {
    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;
        }
    }

    public static void main(String[] args) {
        FastReader fs = new FastReader();

        int n = fs.nextInt();

        String s = fs.next();

        boolean flag = true ;
        int co = 2;
        int co2 = 0 ;
        for(int i = 0 ; i<s.length() -1 ; i++){
            if(s.charAt(i+1) - s.charAt(i) >= 0){
                co2++;
            }
        }
        if(co2 == n-1){
            System.out.println("NO");
            flag = false;

        }else{
            s = s.substring(co2,n);
        }
        while(flag){

            if(co==n || !flag){
                System.out.println("NO");
                break;
            }

            for(int i=0 ; i < s.length() ; i ++){
                String sub = "";
                if(s.charAt(i)!='a'){
                    if(i+co < n) {
                        sub = s.substring(i, i + co);

                    }else{
                        break;
                    }
                    if(((int)sub.charAt(sub.length()-1)-(int)s.charAt(i))<0){
                        System.out.println("YES");
                        System.out.println((i+1)+" "+(i+co));
                        flag = false;
                        break;
                    }
                }
            }

            co++;

        }

































    }
}
