import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A_ReverseSubstring {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String string = br.readLine();

        for (int i = 0; i < string.length()-1; i++) {
            for (int j = string.length()-1; j > i; j--)
            if (string.charAt(i) > string.charAt(j)) {
                System.out.println("YES\n" + i+1 + " " + j+1);
                return;
            }
        }
        System.out.println("NO");
    }
}
