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