#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  string ans = "";
  char a = 'a', b = 'a';
  for (int i = 0; i < n; ++i) {
    if (s[i] >= a) {
      a = s[i];
      ans += '0';
    } else {
      if (s[i] >= b) {
        b = s[i];
        ans += '1';
      } else {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
  cout << ans << "\n";
  return 0;
}
