#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int maxn = 1e5 + 5;
const double EPS = 1e-6;
using namespace std;
int a[52] = {0};
int main() {
  string s;
  cin >> s;
  bool fg = true;
  for (int i = 0; i < (s.size()); ++i) {
    a[s[i] - 'a']++;
    if (a[s[i] - 'a'] > (int)s.size() / 2) fg = false;
  }
  puts(fg ? "YES" : "NO");
  return 0;
}
