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