#include <bits/stdc++.h>
using namespace std;
struct node {
  int index;
  int color;
  char c;
};
bool cmp(node a, node b) { return a.index < b.index; }
int main() {
  int n;
  cin >> n;
  char str[205];
  getchar();
  scanf("%s", str);
  node ch[205];
  for (int i = 0; i < n; i++) {
    ch[i].index = i;
    ch[i].c = str[i];
    ch[i].color = -1;
  }
  ch[0].color = 0;
  for (int i = 1; i < n; i++) {
    for (int j = i - 1; j >= 0; j--) {
      if (ch[j + 1].c < ch[j].c) {
        if (ch[j + 1].color == -1) {
          ch[j + 1].color = !ch[j].color;
          swap(ch[j], ch[j + 1]);
        } else if (ch[j + 1].color != ch[j].color) {
          swap(ch[j], ch[j + 1]);
        } else {
          cout << "NO" << endl;
          return 0;
        }
      } else {
        if (ch[j + 1].color == -1) ch[j + 1].color = ch[j].color;
        break;
      }
    }
  }
  cout << "YES" << endl;
  sort(ch, ch + n, cmp);
  for (int i = 0; i < n; i++) {
    cout << ch[i].color;
  }
  return 0;
}
