#include <bits/stdc++.h>
using namespace std;
long long t, d, ct, q, ans, l, m, r, n, mx, mn, i, j, k, x, y, z, s;
char ch;
string ss = "", str = "";
long long a[200005], b[200005];
vector<long long> g[200005];
bool vis[200005];
long long c[200005];
void dfs(long long node, long long col) {
  vis[node] = 1;
  c[node] = col;
  for (auto h : g[node]) {
    if (vis[h]) {
      if (c[h] == col) {
        cout << "NO";
        exit(0);
      }
      continue;
    }
    dfs(h, col ^ 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  s = k = d = l = mx = m = mn = r = q = i = j = z = x = y = ct = ans = 0;
  cin >> n >> ss;
  for (i = 0; i < n; i++)
    for (j = i + 1; j < n; j++)
      if (ss[i] > ss[j]) g[i].push_back(j), g[j].push_back(i);
  for (i = 0; i < n; i++)
    if (!vis[i]) dfs(i, 0);
  cout << "YES\n";
  for (i = 0; i < n; i++) cout << c[i];
  return 0;
}
