#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0);
const int oo = 2e9;
const int N = 205;
const int AL = 26;
vector<int> idx[AL];
vector<int> adj[N];
int clr[N];
bool dfs(int u, int c = 0);
int main() {
  int n;
  scanf("%d", &(n));
  string s(n, ' ');
  for (int i = 0; i < n; i++) scanf(" %c", &s[i]);
  memset(clr, -1, sizeof(clr));
  for (int i = 0; i < n; i++) {
    int x = s[i] - 'a';
    for (int c = x + 1; c < AL; c++) {
      for (auto& j : idx[c]) {
        adj[i].push_back(j);
        adj[j].push_back(i);
      }
    }
    idx[x].push_back(i);
  }
  bool valid = true;
  for (int i = 0; i < n; i++) {
    if (clr[i] == -1) valid &= dfs(i);
  }
  if (valid) {
    puts("YES");
    for (int i = 0; i < n; i++) {
      printf("%d", clr[i]);
    }
    printf("\n");
  } else
    printf("NO\n");
  return 0;
}
bool dfs(int u, int c) {
  clr[u] = c;
  bool ret = true;
  for (auto& v : adj[u]) {
    if (clr[v] == -1)
      ret &= dfs(v, !c);
    else if (c == clr[v])
      return false;
  }
  return ret;
}
