#include <bits/stdc++.h>
using namespace std;
const int vx[4] = {0, 1, 0, -1};
const int vy[4] = {1, 0, -1, 0};
string s;
int a[30];
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    a[s[i] - 'a']++;
  }
  for (int i = 0; i < 30; i++) {
    if (a[i] >= (s.size() - a[i]) * 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
