#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define TASKNAME "abc"

const int MaxN = 26;

char s [MaxN + 1];
bool b [MaxN];
int a [MaxN], c [MaxN];

int main (void)
{
 int i, j, k, l, n;
 freopen (TASKNAME ".in", "rt", stdin);
 freopen (TASKNAME ".out", "wt", stdout);
 while (scanf (" %s", s) != EOF)
 {
  n = strlen (s);
  assert (n == MaxN);
  memset (c, 0, sizeof (c));
  for (i = 0; i < MaxN; i++)
  {
   assert (s[i] >= 'A' && s[i] <= 'Z');
   a[i] = s[i] - 'A';
   c[a[i]]++;
  }
  for (i = MaxN - 2; i >= 0; i--)
   c[i] += c[i + 1];
  for (i = 0; i < MaxN; i++)
   if (c[i] < MaxN - i)
    break;
  if (i < MaxN)
  {
   printf ("NO\n");
  }
  else
  {
   printf ("YES\n");
   memset (b, 0, sizeof (b));
   for (i = 0; i < MaxN; i++)
   {
    k = MaxN, l = -1;
    for (j = 0; j < MaxN; j++) if (!b[j])
     if (a[j] >= i && k > a[j])
      k = a[j], l = j;
    assert (l != -1);
    b[l] = true;
    printf ("%d%c", l + 1, (i + 1 < MaxN) ? ' ' : '\n');
   }
  }
 }
 return 0;
}
