#include <bits/stdc++.h>
using namespace std;
string S;
int main() {
  cin >> S;
  int n = S.size();
  long long c[26] = {};
  for (int i = 0; i < n; i++) c[S[i] - 'a']++;
  int f = 1;
  for (int i = 0; i < 26; i++)
    if (c[i] > n / 2) f = 0;
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
