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