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

public class abc_vv{
  public static void main(String[] args) throws Exception{
    Scanner in = new Scanner(new File("abc.in"));
    PrintWriter out = new PrintWriter(new FileWriter(new File("abc.out")));
    String x = in.next();
    boolean[] gone = new boolean[26];
    int[] res = new int[26];
    for(int i=0;i<26;i++){
      int k = 'Z'+1;
      int kk = -1;
      for(int j=0;j<26;j++){
        if (x.charAt(j)>=i+'A' && !gone[j] && x.charAt(j)<k){
          k = x.charAt(j); kk = j;
        }
      }
      if (kk == -1){
        out.println("NO"); out.close();
        return;        
      }
      gone[kk] = true;
      res[i] = kk+1;

    }
    out.println("YES");
    for(int i=0;i<26;i++)
      out.print(res[i]+" ");
    out.println();
    out.close();
  }
}
