#include <bits/stdc++.h>
using namespace std;
template <class T>
bool uin(T& a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T& a, T b) {
  return a < b ? (a = b, true) : false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  string S;
  cin >> N >> S;
  string zero = "a", one = "a";
  string colors;
  for (int i = 0; i < N; ++i) {
    if (S[i] >= zero.back()) {
      zero += S[i];
      colors += '0';
    } else if (S[i] >= one.back()) {
      one += S[i];
      colors += '1';
    } else {
      cout << "NO" << '\n';
      return 0;
    }
  }
  cout << "YES" << '\n';
  cout << colors << '\n';
}
