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