#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
const int MOD = 1000000007;
const ll INF = 1e18;
const double EPS = 1e-9;
const double PI = acos(-1);
void solve() {
  int n;
  string str;
  cin >> n >> str;
  vector<int> vec(n, -1);
  for (int j = n - 1; j >= 0; --j) {
    if (vec[j] == -1) {
      vec[j] = 0;
      char m = str[j];
      for (int i = j - 1; i >= 0; --i) {
        if (str[i] > m) {
          vec[i] = vec[j] ^ 1;
        }
      }
    }
  }
  for (int j = n - 1; j >= 0; --j) {
    char m = str[j];
    int num = vec[j];
    for (int i = j - 1; i >= 0; --i) {
      if (str[i] > m and vec[i] == num) {
        cout << "NO" << '\n';
        return;
      }
    }
  }
  cout << "YES" << '\n';
  for (int i : vec) {
    cout << i;
  }
  cout << '\n';
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t_num = 1;
  while (t_num--) {
    solve();
  }
  return 0;
}
