#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string ans = "";
  ans += "0";
  char x = s[0];
  for (int i = 1; i < s.size(); i++) {
    if (s[i] < x) {
      ans += "1";
    } else {
      ans += "0";
      x = s[i];
    }
  }
  char a = 'z';
  char b = 'z';
  for (int i = 0; i < ans.size(); i++) {
    if (ans[i] == '0') {
      if (a == 'z') {
        a = s[i];
      } else if (a > s[i]) {
        cout << "No";
        return 0;
      } else {
        a = s[i];
      }
    } else {
      if (b == 'z') {
        b = s[i];
      } else if (b > s[i]) {
        cout << "NO";
        return 0;
      } else {
        b = s[i];
      }
    }
  }
  cout << "YES\n";
  cout << ans << '\n';
  return 0;
}
