#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c1 = 0, c2 = 0;
  string s, ans = "";
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    int c = s[i] - 'a';
    if (c >= c1)
      ans += "0", c1 = c;
    else if (c >= c2)
      ans += "1", c2 = c;
    else {
      printf("NO\n");
      return 0;
    }
  }
  cout << "YES\n" << ans << endl;
  return 0;
}
