#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
long long dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
string S;
long long cnt[26];
signed main() {
  cin >> S;
  for (long long i = 0; i < S.length(); i++) {
    cnt[S[i] - 'a']++;
  }
  long long t = 0, b = 114514;
  for (long long i = 0; i < 26; i++) {
    t = max(t, cnt[i]);
    b = min(b, cnt[i]);
  }
  if (t - b <= 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
