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

/* Name of the class has to be "Main" only if the class is public. */
public class Balloons
{
    public static void main (String[] args) throws java.lang.Exception
    {
    try {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());  
        String s=br.readLine();
        String s1[]=s.split(" ");
        StringBuilder sb=new StringBuilder();
        int l=0,r=0,dif=0;
        for(int i=0;i<n;i++)
        {
            for(int j=i+1;j<n;j++)
            {
               String k=s.substring(i,j);
               //System.out.println(k+" "+j);
               sb.append(k);
               sb=sb.reverse();
              // System.out.println("reverse "+sb);
               if(s.contains(sb.toString()) &&  n>dif)
               {
             //  System.out.println("ENTER    "+k+" "+(j-i));
                   l=i;
                   r=j;
                   dif=r-l;
               }
               sb.setLength(0);
            }
        }
        if(l!=0 && r!=0)
        {
            System.out.println("Yes");
            System.out.println((l+1)+" "+(r+1));
        }else
            System.out.println("No");
    } catch(Exception e) {
    return;}
    }
}
