import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner reader=new Scanner(System.in);
		int n=reader.nextInt();
		String all=reader.next();
		char str[]=new char[n];
		int l=0;
		int r=0;
		for(int i=0;i<n;i++) {
			str[i]=all.charAt(i);
		}
		for(int i=0;i<n;i++) {
			if(str[i]!='a') {
				l=i;
				for(int j=i+1;j<n;j++) {
					if(str[j]<str[i]) {
						r=j;
						break;
					}
				}
			}
		}
		if(r!=0) {
			System.out.println("YES\n"+(l+1)+" "+(r+1));
		}else {
			System.out.println("NO");
		}
	}

}