#include <bits/stdc++.h>
using namespace std;
const long long hmod1 = 999999937;
const long long hmod2 = 1000000000 + 9;
const long long INF = 1 << 30;
const long long INFLL = 1LL << 62;
const double EPS = 1e-12;
const long long mod = 1000000000 + 7;
const long long dx4[4] = {1, 0, -1, 0};
const long long dy4[4] = {0, 1, 0, -1};
const long long dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const long long dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;
string s;
long long cnt[3];
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> s;
  long long n = s.size();
  if (n == 1) {
    cout << "NO" << endl;
    return 0;
  }
  if (n == 2) {
    for (long long i = 0; i < (n); i++) {
      cnt[s[i] - 'a']++;
    }
    for (long long i = 0; i < (n); i++) {
      if (cnt[i] == 2) {
        cout << "NO" << endl;
        return 0;
      }
    }
    cout << "YES" << endl;
    return 0;
  }
  for (long long i = 0; i < (n); i++) {
    cnt[s[i] - 'a']++;
  }
  if (cnt[0] == 0 || cnt[1] == 0 || cnt[2] == 0) {
    cout << "NO" << endl;
    return 0;
  }
  long long t = n / 3;
  long long m = n - t * 3;
  bool ok = true;
  if (m == 0) {
    for (long long i = 0; i < (3); i++) {
      if (cnt[i] - t < 0) ok = false;
    }
  } else if (m == 1) {
    for (long long i = 0; i < (3); i++) {
      if (cnt[i] - t < 0) ok = false;
      if (cnt[i] - t >= 2) ok = false;
    }
  } else {
    for (long long i = 0; i < (3); i++) {
      if (cnt[i] - t < 0) ok = false;
      if (cnt[i] - t >= 2) ok = false;
    }
  }
  if (ok) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
