#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  string inp;
  cin >> n >> inp;
  vector<bool> colors(n, 0);
  bool breaker = 0;
  for (int i = 1; i < n; i++) {
    bool assigned = 0;
    for (int j = i - 1; j > -1; j--) {
      if (inp[i] < inp[j]) {
        if (!assigned) {
          assigned = 1;
          colors[i] = colors[j] ^ 1;
        } else {
          if (colors[i] == colors[j]) {
            cout << "NO" << endl;
            breaker = 1;
            break;
          }
        }
      }
    }
    if (breaker) break;
  }
  if (!breaker) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << colors[i];
    }
    cout << endl;
  }
  return 0;
}
