#include <bits/stdc++.h>
using namespace std;
stack<int> q1, q2;
string a;
int tag[201];
int main() {
  int n, flag = 1;
  cin >> n;
  cin >> a;
  q1.push(a[0]);
  tag[0] = 1;
  for (int i = 1; i < n; i++) {
    if (q2.empty()) {
      if (a[i] >= q1.top()) {
        q1.push(a[i]);
        tag[i] = 1;
      } else {
        q2.push(a[i]);
        tag[i] = 0;
      }
    } else {
      int k1 = a[i] - q1.top(), k2 = a[i] - q2.top();
      if (max(k1, k2) < 0) {
        cout << "NO" << endl;
        flag = 0;
        break;
      } else if (k1 >= 0) {
        if (k1 < k2) {
          q1.push(a[i]);
          tag[i] = 1;
        } else {
          q2.push(a[i]);
          tag[i] = 0;
        }
      } else {
        if (k2 >= 0) q2.push(a[i]);
        tag[i] = 0;
      }
    }
  }
  int lr = 0;
  if (flag) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << tag[i];
    }
    cout << endl;
  }
  return 0;
}
