import java.util.Collections;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n =scan.nextInt();
	String str = scan.next();
	char a[] = str.toCharArray();
	for (int i = 0; i < a.length-1; i++) {
		if(a[i]>a[i+1]){
			System.out.println("YES");
			System.out.println(i+" "+(i+1));
			break;
		}
		if(i==a.length-2){
			System.out.println("NO");
			break;
			
		}
		
	}
	
}
}