#include <bits/stdc++.h>
using namespace std;
int64_t mod = 1e9 + 7;
int64_t INF = 1e9 + 18;
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int64_t n = (int64_t)s.size();
  int64_t a[3] = {};
  for (int64_t i = 0; i < n; i++) a[s[i] - 'a']++;
  sort(a, a + 3);
  if ((a[0] == a[1] && a[1] == a[2]) || (a[0] + 1 == a[2] && a[1] == a[2]) ||
      (a[0] + 1 == a[2] && a[0] && a[1])) {
    cout << ("YES") << '\n';
    ;
  } else {
    cout << ("NO") << '\n';
    ;
  }
  return 0;
}
