#include <bits/stdc++.h>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
template <class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
  string s;
  cin >> s;
  vector<int> v(3, 0);
  for (auto &&i : s) {
    v[i - 'a']++;
  }
  for (auto &&j : v) {
    if (s.length() / 3 > j) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
