
import java.util.*;public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String x = sc.next();
		for(int i=0;i<n;++i){
		   for(int j=i+1;j<n;++j){
			   if(x.charAt(i)>x.charAt(j)){
				   System.out.println("YES");
				   System.out.println((i+1)+" "+(j+1));
				   System.exit(0);
			   }
		   }
		   System.out.println("NO");
		}
	}
}