
import java.util.*;
public class reverse_string {

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		String str = sc.next();
		
		
	
		
		char[] arr = new char[n];
		
		for(int x = 0, z = str.length()-1 ; x < n ; x++,z--)
			arr[x] = str.charAt(z);
		
		String res = str.charAt(0)+""+str.charAt(1)+""+str.charAt(2);
		boolean contains = false;
		int start = -1, end = -1;
		for(int i = 3; i < str.length();i++)
		{
			contains = CompareReverse(arr,res);
			if(contains)
			{
				start = (i - 3);
				end = i -1;
				break;
			}
			res+=""+str.charAt(i);
		}
		
		if(start != -1 )
		{
			System.out.println("YES");
			System.out.println(start+" "+end);
		}
		else
			System.out.println("NO");

	}

	private static boolean CompareReverse(char[] arr, String res) {
		
		for(int i = 0 ; i < arr.length ;i++)
		{	
			if((i+res.length()-1) < arr.length)
			if(arr[i] == res.charAt(0) &&
				arr[i+res.length()-1] == res.charAt(res.length()-1))
			{
				for(int j = 0 ; j < res.length();j++)
					{
					if(i+j < arr.length)
					if(arr[i+j] == res.charAt(j))
					{
						if(j == res.length() -1)
							return true;
						continue;
					}
					else
						break;
					}
			}
				
		}
		
		return false;
		
	}
	
	
}
