#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = 1LL << 40;
const double PI = atan(1) * 4;
const long long MOD = pow(10, 9) + 7;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  }
  return os;
}
int main() {
  string s;
  cin >> s;
  int cnt[128] = {0};
  for (int i = 0; i < s.size(); i++) {
    cnt[s[i]]++;
  }
  if ((cnt['a'] - cnt['b']) >= 2)
    cout << "NO" << endl;
  else if ((cnt['a'] - cnt['c']) >= 2)
    cout << "NO" << endl;
  else if ((cnt['c'] - cnt['b']) >= 2)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
