#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 = 1, le = 0, ri, flag = 0;
  for (register int i = 1; i <= n; i++) num[c[i] - 'a']++;
  sort(num, num + 26, greater<int>());
  for (register int i = 25;; i--)
    if (num[i]) {
      ri = i;
      break;
    }
  while (le < ri - 1) {
    if (num[le] - 1 > num[ri]) {
      num[le] -= num[ri];
      num[ri - 1] -= num[ri];
      ri--;
    } else {
      num[ri] -= num[le] - 1;
      num[ri - 1] -= num[le] - 1;
      num[le] = 0;
      le++;
    }
  }
  for (register int i = 0; i < 26; i++) {
    if (num[i] != 0 && num[i] != 1)
      tag = 0;
    else if (num[i] == 1 && flag)
      tag = 0;
    else if (num[i] == 1)
      flag = 1;
  }
  if (!tag)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
