#include <bits/stdc++.h>
using namespace std;
long long const INF = 1000000007;
long long mod = 1e9 + 7;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  return gcd(b, a % b);
}
struct hash_pair {
  template <class T1, class T2>
  size_t operator()(const pair<T1, T2>& p) const {
    auto hash1 = hash<T1>{}(p.first);
    auto hash2 = hash<T2>{}(p.second);
    return hash1 ^ hash2;
  }
};
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
bool isPerfectSquare(long double x) {
  if (x >= 0) {
    long long sr = sqrt(x);
    return (sr * sr == x);
  }
  return false;
}
long long fast_pow(long long a, long long p) {
  long long res = 1;
  while (p) {
    if (p % 2 == 0) {
      a = (a * a) % mod;
      p /= 2;
    } else {
      res = (res * a) % mod;
      p--;
    }
  }
  return res;
}
void test() {
  long long n, i, j;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> ans(n);
  ans[0] = 0ll;
  vector<pair<char, long long>> v;
  for (i = 0; i < n; i++) v.push_back({s[i], 0ll});
  for (i = 1; i < n; i++) {
    if (v[i].first >= v[i - 1].first) {
      ans[i] = v[i - 1].second;
      v[i].second = v[i - 1].second;
      continue;
    }
    ans[i] = 1 ^ v[i - 1].second;
    v[i].second = 1 ^ v[i - 1].second;
    for (j = i - 1; j >= 0; j--) {
      if (v[j].first <= v[j + 1].first) break;
      if (v[j].second == v[j + 1].second) {
        cout << "NO"
             << "\n";
        return;
      }
      swap(v[j], v[j + 1]);
    }
  }
  cout << "YES"
       << "\n";
  for (i = 0; i < n; i++) cout << ans[i];
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  long long i = 1;
  while (t--) {
    test();
    i++;
  }
  return 0;
}
