#include <bits/stdc++.h>
using namespace std;
long long fn(long long x, long long rn[]) {
  if (rn[x] == x)
    return x;
  else
    return rn[x] = fn(rn[x], rn);
}
void un(long long x, long long y, long long rn[], long long sz[]) {
  x = fn(x, rn);
  y = fn(y, rn);
  if (x == y) return;
  if (sz[x] < sz[y]) swap(x, y);
  sz[x] += sz[y];
  rn[y] = x;
  return;
}
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
vector<long long> adjl[100001];
long long marked[100001] = {0};
vector<long long> order;
void dfs(long long x) {
  if (marked[x]) return;
  marked[x] = 1;
  for (long long i = 0; i < adjl[x].size(); i++) {
  }
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q = 1;
  while (q--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    int flag = 0;
    int colour[n];
    for (long long i = 0; i < n; i++) {
      colour[i] = -1;
    }
    for (long long i = 0; i < n; i++) {
      long long diff = s[i] - 'a';
      for (long long j = 0; j < i; j++) {
        if ((s[j] - 'a') > diff) {
          colour[i] = 0;
          break;
        }
      }
      for (long long j = i + 1; j < n; j++) {
        if ((s[j] - 'a') < diff) {
          if (colour[i] == -1) {
            colour[i] = 1;
            break;
          } else {
            flag = 1;
            break;
          }
        }
      }
      if (colour[i] == -1) {
        colour[i] = 0;
      }
      if (flag) break;
    }
    if (flag) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      for (long long i = 0; i < n; i++) {
        cout << colour[i];
      }
      cout << endl;
    }
  }
  return 0;
}
