import java.util.Scanner;

public class Main04 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			int n = sc.nextInt();
			char[] e = sc.next().toCharArray();
			int a = 0,b = 0;
			int k = 0;
			for(int i=0;i<n-1;i++) {
				for(int j=i+1;j<n;j++) {
					if(e[i]>e[j]||e[i]>e[n-j]) {
						a = i;b = (e[i]>e[j]?j:(n-j));
						k = 1;
						break;
					}
				}
				if(k==1) {
					break;
				}
			}
			if(k==1) {
				System.out.println("YES");
				System.out.println((a+1) + " " + (b+1));
			}else {
				System.out.println("NO");
			}
		}
	}
}
