#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> cnt(3, 0);
  for (long long i = 0; i < (long long)(n); i++) {
    cnt[s[i] - 'a']++;
  }
  sort((cnt).begin(), (cnt).end());
  if (cnt[0] > 0) {
    if ((n + 1) / 2 >= cnt[2]) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  } else {
    if (cnt[1] == cnt[2]) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
  return 0;
}
