#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e2 + 20;
long long mod = 1e9 + 7;
bool mark[maxn], c[maxn][maxn], a[maxn][2];
double dp[maxn][maxn][maxn];
const int inf = 1e9;
int main() {
  int n;
  cin >> n;
  string s, x;
  cin >> s;
  x = s;
  sort(x.begin(), x.end());
  for (int i = n - 1; i >= 0; i--)
    for (int j = 0; j < n; j++)
      if (s[j] == x[i] && !mark[j]) {
        mark[j] = 1;
        for (int k = j + 1; k < n; k++)
          if (!mark[k] && s[j] != s[k]) c[j][k] = 1;
      }
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (c[i][j] == 1)
        for (int k = j + 1; k < n; k++)
          if (c[i][k] == 1 && c[j][k] == 1) return cout << "NO", 0;
  cout << "YES" << endl;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = n - 1; j >= 0; j--)
      if (s[j] == x[i] && !a[j][1]) {
        a[j][1] = 1;
        a[j][0] = 1;
        for (int k = j + 1; k < n; k++)
          if (!a[k][1]) {
            a[k][1] = 1;
            a[k][0] = abs(a[j][0] - c[j][k]);
          }
        break;
      }
  }
  for (int i = 0; i < n; i++) cout << a[i][0];
}
