#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int TN = 1;
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> color(n, 0);
  vector<int> answer(n, 0);
  for (int i = 1; i < n; ++i) {
    if (s[i] < s[i - 1]) {
      answer[i] = 1;
      color[i] = 1;
      for (int j = i; j > 0; --j) {
        if (s[j] < s[j - 1]) {
          if (color[j - 1] == 1) {
            cout << "NO\n";
            return;
          }
          swap(s[j], s[j - 1]);
          swap(color[j], color[j - 1]);
        }
      }
    }
  }
  cout << "YES\n";
  for (int i : answer) {
    cout << i;
  }
  cout << '\n';
}
int main() {
  auto start = chrono::steady_clock::now();
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  while (TN--) {
    solve();
  }
  auto finish = chrono::steady_clock::now();
  auto elapsed_ms = chrono::duration_cast<chrono::milliseconds>(finish - start);
  cerr << endl << "Time: " << elapsed_ms.count() << " ms\n";
  return 0;
}
