import java.util.Scanner;

public class Reverse {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		String b = scan.next();
		int min = 0;
		int max = 0;
		boolean boo = false;
		for (int i = 1; i< a; i++){
			if (b.charAt(i) > b.charAt(i-1)){
				continue;
			} else if (b.charAt(i) == b.charAt(i-1)){
				min = i-1;
				boo = true;
			}else{
				if (boo == true){
					continue;
				} else{
					min = i-1;
				}
				max = i;
				break;
			}
		}
		if (min ==0 && max == 0) {
			System.out.println("NO");
		} else{
			System.out.println("YES");
			System.out.println(min + " " + max);
		}
		

	}

}
