#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool p = true;
  vector<int> a(n, 0);
  for (int i = 1; i < n; i++) {
    for (int j = i - 1; j >= 0; j--) {
      if (s[i] < s[j]) {
        a[i] = 1;
        break;
      }
    }
  }
  for (int i = 1; i < n; i++) {
    if (a[i] == 1) {
      for (int j = i - 1; j >= 0; j--) {
        if (a[j] == 1 && s[j] > s[i]) {
          p = false;
          break;
        }
      }
    }
    if (!p) break;
  }
  if (p) {
    cout << "YES\n";
    for (int i : a) cout << i;
  } else
    cout << "NO";
  return 0;
}
