#include <bits/stdc++.h>
using namespace std;
void qsort(int arr[], int l, int r) {
  int i = l, j = r, m = arr[(l + r) >> 1];
  do {
    while (arr[i] < m) ++i;
    while (arr[j] > m) --j;
    if (i <= j) {
      int t = arr[i];
      arr[i] = arr[j];
      arr[j] = t;
      ++i;
      --j;
    }
  } while (i <= j);
  if (l < j) qsort(arr, l, j);
  if (i < r) qsort(arr, i, r);
}
int main() {
  int n;
  string s, res = "";
  cin >> n >> s;
  char a = 'a', b = 'a';
  for (int i = 0; i < n; ++i) {
    if (s[i] >= a) {
      res += "0";
      a = s[i];
    } else if (s[i] >= b) {
      res += "1";
      b = s[i];
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES\n" << res << endl;
  return 0;
}
