#include <bits/stdc++.h>
using namespace std::chrono;
using namespace std;
long long int bit(string s) {
  long long int k = 1;
  long long int n = s.size();
  long long int num = 0;
  for (long long int i = n - 1; i >= 0; --i) {
    num += (s[i] - '0') * k;
    k *= 2;
  }
  return num;
}
bool sortbysec(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b) {
  return (a.second < b.second);
}
long long int countDivisors(long long int n) {
  long long int cnt = 0;
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt = cnt + 2;
    }
  }
  return cnt;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int findGCD(long long int arr[], long long int n) {
  long long int result = arr[0];
  for (long long int i = 1; i < n; i++) result = gcd(arr[i], result);
  return result;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
double diff(double n, double mid) {
  if (n > (mid * mid * mid))
    return (n - (mid * mid * mid));
  else
    return ((mid * mid * mid) - n);
}
double cubicRoot(double n) {
  double start = 0, end = n;
  double e = 0.0000001;
  while (true) {
    double mid = (start + end) / 2;
    double error = diff(n, mid);
    if (error <= e) return mid;
    if ((mid * mid * mid) > n)
      end = mid;
    else
      start = mid;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int test = 1;
  while (test--) {
    long long int n, ans = 0;
    cin >> n;
    string s, t = "";
    cin >> s;
    char x = 'a', y = 'a';
    for (int i = 0; i < n; ++i) {
      if (s[i] >= x) {
        x = s[i];
        t += "1";
      } else if (s[i] >= y) {
        y = s[i];
        t += "0";
      } else {
        ans = 1;
      }
    }
    if (ans) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      cout << t << endl;
    }
  }
  return 0;
}
