#include <bits/stdc++.h>
using namespace std;
const long long int N = 2e3 + 15;
const long long int inf = 1e18;
void solve() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  string ans;
  char last1 = 'a', last2 = 'a';
  for (auto x : s) {
    if (x >= last1)
      ans += '0', last1 = x;
    else if (x >= last2)
      ans += '1', last2 = x;
    else {
      cout << "NO";
      return;
    }
  }
  cout << "YES"
       << "\n";
  cout << ans;
}
void debug(long long int tt) {}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
