#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;
}
int dy[4] = {0, 0, 1, -1};
int dx[4] = {1, -1, 0, 0};
int dxx[9] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
int dyy[9] = {0, 1, -1, 0, 1, -1, 0, 1, -1};
long long gcd(long long x, long long y) {
  long long m = max(x, y), n = min(x, y);
  if (m % n == 0)
    return n;
  else
    return gcd(m % n, n);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long power_mod(long long x, long long n, long long m) {
  if (n == 0) return 1;
  if (n % 2 == 0)
    return power_mod(x * x % m, n / 2, m);
  else
    return x * power_mod(x, n - 1, m) % m;
}
long long power(long long a, long long n) {
  long long x = 1;
  while (n > 0) {
    if (n & 1) {
      x = x * a;
    }
    a = a * a;
    n >>= 1;
  }
  return x;
}
long long nCr(long long n, long long r) {
  if (r > n / 2) r = n - r;
  long long ans = 1;
  long long i;
  for (i = 1; i <= r; i++) {
    ans *= n - r + i;
    ans /= i;
  }
  return ans;
}
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
bool arr[100000100];
vector<long long> sosuu;
void Eratosthenes() {
  long long N = 10000010;
  int c = 0;
  for (int i = 0; i < N; i++) {
    arr[i] = 1;
  }
  for (long long i = 2; i < sqrt(N); i++) {
    if (arr[i]) {
      for (long long j = 0; i * (j + 2) < N; j++) {
        arr[i * (j + 2)] = 0;
      }
    }
  }
  for (long long i = 2; i < N; i++) {
    if (arr[i]) {
      sosuu.push_back(i);
      c++;
    }
  }
}
long long stoL(string s) {
  long long n = s.length();
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += power(10, n - i - 1) * (long long)(s[i] - '0');
  }
  return ans;
}
int main() {
  string S;
  cin >> S;
  int N = S.size();
  int A = 0, B = 0, C = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == 'a')
      A++;
    else if (S[i] == 'b')
      B++;
    else
      C++;
  }
  if (max(A, max(B, C)) > N / 2) {
    cout << "NO" << endl;
    ;
  } else
    cout << "YES" << endl;
  ;
}
