#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> a(n);
  char ss = s[1];
  char ii = s[1];
  for (int i = 0; i < n; i++) {
    bool ss = false;
    for (int j = 0; j < i; j++) {
      if (s[i] < s[j]) {
        if (ss) {
          if (a[i] != 1 - a[j]) {
            cout << "NO" << endl;
            return 0;
          }
        } else {
          a[i] = 1 - a[j];
          ss = true;
        }
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    cout << a[i];
  }
  cout << endl;
  return 0;
}
