#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e2 + 10;
const int mod = 998244353;
const long long inf = 1e15;
const double eps = 1e-8;
int n;
char s[maxn];
struct node {
  char ch;
  int id;
  int c;
} no[maxn];
bool cmp(node x, node y) {
  if (x.ch != y.ch) return x.ch < y.ch;
  return x.id < y.id;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    no[i].ch = s[i];
    no[i].id = i;
    no[i].c = -1;
  }
  sort(no + 1, no + 1 + n, cmp);
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == no[i].ch) {
      if (no[i].c == 1) flag = 1;
      no[i].c = 0;
      continue;
    } else {
      int id = i;
      for (int j = i + 1; j <= n; j++) {
        if (no[j].ch == s[i]) {
          id = j;
          break;
        }
      }
      if (no[id].c == 0) {
        flag = 1;
        break;
      }
      no[id].c = 1;
      for (int j = id - 1; j >= i; j--) {
        if (no[j].c == 1) {
          flag = 1;
        }
        no[j].c = 0;
        swap(no[j], no[j + 1]);
      }
    }
  }
  if (flag)
    puts("NO");
  else {
    puts("YES");
    for (int i = 1; i <= n; i++) {
      printf("%d", no[i].c);
    }
    printf("\n");
  }
  return 0;
}
