#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0, flag = 0;
  for (int i = n - 1; i > 0; i--) {
    cnt = 0;
    for (int j = i - 1; j >= 0; j--) {
      if ((int)(s[j]) > (int)(s[i])) {
        cnt++;
        for (int k = j - 1; k >= 0; k--) {
          if ((int)s[k] > (int)(s[j])) {
            flag = 1;
            break;
          }
        }
        if (flag) {
          break;
        }
      }
    }
  }
  if (flag) {
    cout << "NO" << '\n';
    return 0;
  }
  cout << "YES" << '\n';
  int a[n];
  a[0] = 0;
  int lc = (int)s[0];
  int lt = 0;
  for (int i = 1; i < n; i++) {
    if ((int)s[i] < lc) {
      a[i] = 1 - lt;
    } else {
      a[i] = 0;
      lt = 0;
      lc = (int)s[i];
    }
  }
  for (int i = 0; i < n; i++) {
    cout << a[i];
  }
}
