#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / g * b;
}
long long factorial(long long n) {
  long long t = 1;
  for (long long(i) = 1; (i) <= (n); ++(i)) t *= i;
  return t;
}
long long combinations(long long n, long long k) {
  long long r = 1;
  for (long long(i) = 1; (i) <= (k); ++(i)) r = r * n-- / i;
  return r;
}
int main() {
  string s;
  cin >> s;
  long long a = 0, b = 0, c = 0;
  for (long long(i) = 0; (i) < (s.size()); ++(i)) {
    if (s[i] == 'a')
      ++a;
    else if (s[i] == 'b')
      ++b;
    else if (s[i] == 'c')
      ++c;
  }
  if (max({a, b, c}) < (s.size() + 2) / 2)
    cout << ("YES") << endl;
  else
    cout << ("NO") << endl;
  return 0;
}
