#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
string S;
string solve() {
  map<char, int> cnt;
  for (int i = 0; i < S.size(); i++) {
    cnt[S[i]]++;
  }
  vector<char> v;
  for (int i = 0; i < 3; i++) v.push_back(char('a' + i));
  do {
    char c0 = v[0], c1 = v[1], c2 = v[2];
    if (cnt[c0] == cnt[c1] && cnt[c1] == cnt[2]) return "YES";
    if (cnt[c0] == cnt[c1] + 1 && cnt[c1] + 1 == cnt[c2] + 1) return "YES";
    if (cnt[c0] == cnt[c1] && cnt[c1] == cnt[c2] + 1) return "YES";
  } while (next_permutation(v.begin(), v.end()));
  return "NO";
}
int main() {
  cin >> S;
  cout << solve() << endl;
}
