#include <bits/stdc++.h>
using namespace std;
char c[1000000];
int num[100];
int main() {
  scanf("%s", c + 1);
  int n = strlen(c + 1), tag = 0;
  for (register int i = 1; i <= n; i++) num[c[i] - 'a']++;
  sort(num, num + 26);
  for (register int i = 0; i < 25; i++)
    if (num[i]) {
      if (num[i + 1] - num[i] > 1) {
        cout << "NO\n";
        return 0;
      } else if (num[i + 1] == num[i])
        tag = 1;
    }
  if (!tag)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
