#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline void add(T& a, T b) {
  a = ((a + b) % 1000000007 + 1000000007) % 1000000007;
};
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const double PI = acos(-1.0);
const double EPS = 1e-10;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  vector<int> cnt(3);
  for (auto x : S) {
    if (x == 'a')
      cnt[0]++;
    else if (x == 'b')
      cnt[1]++;
    else
      cnt[2]++;
  }
  sort(cnt.rbegin(), cnt.rend());
  if (cnt[0] == cnt[1] && cnt[1] == cnt[2])
    cout << "YES" << endl;
  else if (cnt[0] == cnt[1] + 1 && cnt[1] + 1 == cnt[2] + 1)
    cout << "YES" << endl;
  else if (cnt[0] == cnt[1] && cnt[1] + 1 == cnt[2] + 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
