
import java.io.*;
import java.util.*;
import java.util.Stack;


public class ROUGH {

	
	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		//it reads the data about the specified point and divide the data about it ,it is quite fast
		//than using direct 

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static long mod = (long)(1e9+7);
	
	public static void main(String[] args) {
		 FastReader sc = new FastReader();
		    int n = sc.nextInt();
			String s = sc.next();
			boolean found = false;
			for(int i=1;i<s.length();++i) {
				int a = s.charAt(i-1)-'a';
				int b = s.charAt(i)-'a';
				
				if(a>b) {
					out.println("YES");
					out.println(i+" "+(i+1));
					found = true;
					break;
				}
			}
			if(!found) out.println("NO");
		out.close();
	}
}