import java.util.*;
import java.lang.Math.*;
import java.io.*;
import java.util.PriorityQueue;

/**
 * String reversal
 */
public class Solution {

    Solution() {
        ;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int     N;
        String  inStr;
        int L;
        Solution recurSol = new Solution();
        String   soln;

        N = in.nextInt();
        in.nextLine();
        inStr = in.nextLine();
        soln = recurSol.solve(inStr);
        /** Output goes here. */
        System.out.println(soln);
    }

    public String solve(String S) {
        StringBuilder soln = new StringBuilder();
        soln.setLength(0);

        for (int i = 1; i < S.length(); ++i) {
            if (S.charAt(i) > S.charAt(i - 1)) {
                soln.append("YES\n");
                soln.append(i - 1);
                soln.append(" ");
                soln.append(i);
                return soln.toString();
            }
        }
        return "NO";
    }
 }
