#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
template <class T>
string join(const vector<T>& v, string d = " ") {
  stringstream s;
  for (ll(i) = 0; (i) < ((ll)(v).size()); ++(i)) s << d << v[i];
  return s.str().substr((string(d)).length());
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "{";
  if ((ll)(v).size()) o << join(v, ", ");
  o << "}";
  return o;
}
template <class T, class U>
ostream& operator<<(ostream& o, const pair<T, U>& p) {
  o << "(";
  o << p.first << ", " << p.second;
  o << ")";
  return o;
}
template <class T>
bool contain(const string& s, const T& v) {
  return s.find(v) != string::npos;
}
template <class T, class U>
string& replace(string& s, const T& f, const U& t) {
  for (auto p = s.find(f); p != string::npos;
       p = s.find(f, p + (string(t)).length()))
    s.replace(p, (string(f)).length(), t);
}
const ll INF = 1e15;
const ll MOD = 1e9 + 7;
const double EPS = 1e-10;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int main() {
  string S;
  cin >> S;
  ll N = (string(S)).length();
  vector<ll> abc(3, 0);
  for (ll(i) = 0; (i) < (N); ++(i)) abc[S[i] - 'a']++;
  vector<P> ps(3);
  for (ll(i) = 0; (i) < (3); ++(i)) ps[i] = {abc[i], i};
  sort((ps).begin(), (ps).end());
  vector<char> c(3);
  for (ll(i) = 0; (i) < (3); ++(i)) c[i] = ps[i].second;
  char prev2 = c[2];
  abc[c[2]]--;
  char prev1 = c[1];
  abc[c[1]]--;
  for (ll(i) = 2; (i) < (N); ++(i)) {
    bool ng = true;
    for (ll(j) = 2; (j) >= (0); --(j))
      if (c[j] != prev2 && c[j] != prev1 && abc[c[j]] > 0) {
        prev2 = prev1;
        prev1 = c[j] + 'a';
        abc[c[j]]--;
        ng = false;
        break;
      }
    if (ng) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
