import java.util.Scanner;

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