#include <bits/stdc++.h>
using namespace std;
int a[300];
int b[300];
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int flag = 0;
  a[0] = 0;
  b[0] = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] >= s[i - 1])
      b[i] = a[i - 1], a[i] = b[i];
    else {
      int k;
      for (k = i + 1; k < n; k++) {
        if (s[k] != s[i]) break;
      }
      k--;
      for (int j = i; j <= k; j++) {
        b[j] = a[i - 1] ^ 1;
        a[j] = b[j];
      }
      for (int j = i; j <= k; j++) {
        int now = j;
        while (now > 0) {
          if (s[now] >= s[now - 1]) break;
          if (a[now] != a[now - 1]) {
            swap(a[now], a[now - 1]);
            swap(s[now], s[now - 1]);
            now--;
          } else {
            flag = 1;
            break;
          }
        }
      }
      i = k;
    }
  }
  if (flag == 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << b[i];
  }
  return 0;
}
