#include <bits/stdc++.h>
using namespace std;
int n, ans[505], dis[505][505];
char c[505];
struct A {
  int x, y;
} a[505];
int main(void) {
  scanf("%d", &n);
  scanf("%s", c + 1);
  for (int i = 1; i <= n; i++) a[i].x = c[i] - 'a', a[i].y = i;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < n; j++) {
      if (a[j].x <= a[j + 1].x) continue;
      if (a[j].y < a[j + 1].y)
        dis[a[j].y][++dis[a[j].y][0]] = a[j + 1].y;
      else
        dis[a[j + 1].y][++dis[a[j + 1].y][0]] = a[j].y;
      swap(a[j].x, a[j + 1].x);
      swap(a[j].y, a[j + 1].y);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!ans[i]) ans[i] = -1;
    for (int j = 1; j <= dis[i][0]; j++) {
      if (ans[dis[i][j]] != 0 && ans[dis[i][j]] != -ans[i]) {
        printf("NO");
        return 0;
      }
      ans[dis[i][j]] = ans[i] * -1;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++)
    if (ans[i] == 1)
      printf("1");
    else
      printf("0");
}
