#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long pp = 1e6;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
long long n, m1, m2, k;
long long a[pp], b[pp];
vector<int> V[pp];
string S, an;
map<long long, long long> M;
set<long long> Set;
void dowork() {
  cin >> n >> S;
  for (int i = 0; i < n; ++i) {
    if (m1 <= S[i]) {
      m1 = S[i];
      an += '0';
    } else if (m2 <= S[i]) {
      m2 = S[i];
      an += '1';
    } else {
      cout << "NO";
      return;
    }
  }
  cout << "YES" << endl;
  cout << an;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  dowork();
  return 0;
}
