#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
using mat = vector<vector<long long>>;
void IOS() { ios::sync_with_stdio(false), cin.tie(0); }
const long long INF = 1e16;
const long long MOD = 1e9 + 7;
long long mod(long long a) {
  if (a > 0) return a % MOD;
  if (a % MOD == 0) return 0;
  long long x = -a / MOD + 1;
  a += x * MOD;
  return a % MOD;
}
template <typename T>
void dump(T x) {
  cout << x << endl;
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  fill((T *)array, (T *)(array + N), val);
}
int main() {
  IOS();
  string s;
  cin >> s;
  int n = s.size();
  long long cnt[26] = {};
  for (int i = 0; i < n; ++i) {
    cnt[s[i] - 'a']++;
  }
  bool ok = true;
  for (int i = 0; i < 26; ++i) {
    if (cnt[i] > n / 2) ok = false;
  }
  dump(ok ? "YES" : "NO");
  return 0;
}
