/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package codeforces;

/**
 *
 * @author Dhruv
 */
import java.io.*;
public class Reverse_a_Substring {
    public static void main(String args[]) throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        String str=br.readLine();
        int l=0;
        int r=str.length()-1;
        while(l!=r && str.charAt(l)<=str.charAt(r)){
            l++;
        }
        while(l!=r && str.charAt(r)>=str.charAt(l)){
            r--;
        }
        if(l==r){
            System.out.println("NO");
        }
        else{
            System.out.println("YES");
            System.out.println((l+1)+" "+(r+1));
        }
    }
}
