#include <bits/stdc++.h>
using namespace std;
int num[210];
bool vis[210];
signed main() {
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    memset(vis, 0, sizeof(vis));
    for (int j = 1; j < i; j++) {
      if (s[j - 1] > s[i - 1]) vis[num[j]] = 1;
    }
    for (int j = 1;; j++)
      if (!vis[j]) {
        num[i] = j;
        break;
      }
  }
  for (int i = 1; i <= n; i++)
    if (num[i] > 2) {
      cout << "NO" << endl;
      return 0;
    }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << num[i] - 1;
  cout << endl;
  return 0;
}
