#include <bits/stdc++.h>
using namespace std;
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int cnt[3] = {};
  string s;
  cin >> s;
  for (int i = (0); i < (s.size()); i++) {
    cnt[s[i] - 'a']++;
  }
  bool ok = false;
  for (int i = (0); i < (3); i++)
    for (int j = (0); j < (3); j++) {
      if (abs(cnt[i] - cnt[j]) > 1) {
        ok = false;
      }
    }
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
