#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
using namespace std;
void _main();
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  _main();
}
string S;
string solve() {
  map<char, int> cnt;
  for (auto &c : S) cnt[c]++;
  if (cnt['a'] == cnt['b'] and cnt['b'] == cnt['c']) return "YES";
  if (cnt['a'] == cnt['b'] + 1 and cnt['a'] == cnt['c'] + 1) return "YES";
  if (cnt['a'] == cnt['b'] and cnt['b'] == cnt['c'] + 1) return "YES";
  return "NO";
}
void _main() {
  cin >> S;
  cout << solve() << endl;
}
