import java.util.*;
public final class Samba{
    public static void main(String[] main){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = sc.next();
        char[] ch = str.toCharArray();
        Arrays.sort(ch);
        String str1 = new String(ch);
        if(str.equals(str1)){
            System.out.print("NO");
        }else{
            System.out.println("YES");
            char[] ch1 = str.toCharArray();
            for(int i = 0;i < n-1;i++){
                System.out.println(i+1+" "+i+3);
            }
        }
    }
}