#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& out, vector<T>& v) {
  out << "[";
  for (auto k : v) out << k << " ";
  out << "]";
  return out;
}
vector<int> g[500];
string color;
bool posible = true;
void DFS(int n, int p, char c) {
  if (color[n] != '-' && color[n] != c) {
    posible = false;
    return;
  }
  if (color[n] != '-') return;
  color[n] = c;
  char nc = '1' - c + '0';
  for (auto k : g[n])
    if (k != p) DFS(k, n, nc);
}
int main() {
  int n;
  string in;
  cin >> n >> in;
  color.resize(n, '-');
  for (int i = 0; i < int(n); i++) {
    for (int j = int(i + 1); j < int(n); j++) {
      if (in[i] > in[j]) {
        g[i].push_back(j);
        g[j].push_back(i);
      }
    }
  }
  for (int i = 0; i < int(n); i++)
    if (color[i] == '-') DFS(i, -1, '0');
  if (posible)
    cout << "YES" << endl << color << endl;
  else
    cout << "NO" << endl;
}
