import java.util.*;
import java.io.*;
import static java.lang.System.out;

public class Substring 
{
    public static void generateSubstring(String st)
    {
        char[] ar = st.toCharArray();
        int limitJ = 0;
        for(int i=0; i<ar.length;)
        {
            String sub = "";
            int j;
            for(j = i; j<=limitJ; ++j)
            {
                sub+= ar[j];
            }
            if(sub.length()>1)
            {
                String revSub = reverse(sub);
                
                if(sub.compareTo(revSub)>0)
                {
                    out.println("YES\n"+(i+1)+" "+(j+1));
                    return;
                }
            }
            if(limitJ+1<ar.length) { ++limitJ; }
            else { ++i; limitJ = i; }
        }
        out.println("NO");
    }
    
    public static String reverse(String st)
    {
        char[] a = st.toCharArray();
        int i = 0, j = a.length-1;
        while(i<j)
        {
            char temp = a[i]; a[i] = a[j]; a[j] = temp;
            ++i; --j;
        }
        return new String(a);
    }
    
    
    public static void main(String[] args) throws Exception
    {
        BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
        int length = Integer.valueOf(b.readLine());
        String s = b.readLine();
        generateSubstring(s);
    }
}
