#include <bits/stdc++.h>
const long long MOD = 1e9 + 7;
using pii = std::pair<long long, long long>;
using namespace std;
long long n;
string s;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> s;
  long long good = 1;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < i; j++)
      for (long long k = 0; k < j; k++)
        if (s[k] > s[j] && s[j] > s[i]) {
          good = 0;
          break;
        }
  long long ans[205] = {0};
  for (long long i = 0; i < n; i++)
    for (long long j = i + 1; j < n; j++)
      if (s[j] < s[i]) ans[j] = !ans[i];
  if (!good)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (long long i = 0; i < n; i++) cout << ans[i];
    cout << "\n";
  }
  return 0;
}
