#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long linf = 1e18;
template <class T>
void chmin(T& x, T y) {
  if (x > y) x = y;
}
template <class T>
void chmax(T& x, T y) {
  if (x < y) x = y;
}
int n;
int ans[200010];
bool used[200010];
string s;
vector<pair<char, int> > v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> s;
  bool flag = true;
  int cnt = 0;
  while (flag) {
    flag = false;
    char c = 'a';
    for (int i = 0; i < n; i++) {
      if (s[i] >= c && !used[i]) {
        ans[i] = cnt;
        c = s[i];
        used[i] = true;
        flag = true;
      }
    }
    cnt++;
  }
  if (cnt > 3) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << ans[i];
    cout << endl;
  }
  return 0;
}
