#include <bits/stdc++.h>
const int MAXN = 1e9 + 7;
const int INF = 1e9 + 7;
using namespace std;
bool comp1(pair<signed long long, signed long long> a,
           pair<signed long long, signed long long> b) {
  if (a.first == b.first) return a.second < b.second;
  return (a.first < b.first);
}
const signed long long MOD = 1e9 + 7;
const int N = 1e3 + 1;
signed long long binpow(signed long long a, signed long long b) {
  signed long long res = 1;
  while (b) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  char s1 = 'a', s2 = 'a';
  string ans = "";
  for (size_t i = 0; i < n; i++) {
    if (s[i] >= s1) {
      s1 = s[i];
      ans += "0";
    } else if (s[i] >= s2) {
      s2 = s[i];
      ans += "1";
    } else {
      cout << "NO"
           << "\n";
      return 0;
    }
  }
  cout << "YES"
       << "\n"
       << ans << "\n";
  return 0;
}
