#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
int n;
char s[maxn];
int b[maxn];
int main() {
  cin >> n >> s + 1;
  int flag = 1;
  for (int i = 1; i <= n && flag; i++) {
    for (int j = i + 1; j <= n && flag; j++) {
      for (int k = j + 1; k <= n && flag; k++) {
        if (s[i] > s[j] && s[j] > s[k]) {
          flag = 0;
        }
      }
    }
  }
  if (!flag) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++)
      if (s[i] > s[j]) b[j] = !b[i];
  }
  for (int i = 1; i <= n; i++) cout << b[i];
  return 0;
}
