#include <bits/stdc++.h>
using namespace std;
int b1[] = {0, 0, 1, -1};
int b2[] = {1, -1, 0, 0};
int d1[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int d2[] = {-1, 0, 1, -1, 1, -1, 0, 1};
list<int> l[10001];
bool vis[10001];
int id[10001];
bool bipartite(int i, int xr) {
  vis[i] = true;
  id[i] = xr;
  for (auto it : l[i]) {
    if (!vis[it]) {
      if (!bipartite(it, 1 ^ xr)) return false;
    } else if (id[i] == id[it])
      return false;
  }
  return true;
}
void solve() {
  string s;
  int n;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (s[i] > s[j]) {
        l[i].push_back(j);
        l[j].push_back(i);
      }
    }
  }
  memset(vis, false, sizeof(vis));
  for (int i = 0; i < n; i++) {
    if (!vis[i]) {
      if (!bipartite(i, 0)) {
        cout << "NO\n";
        return;
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << id[i];
  cout << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
