#include <bits/stdc++.h>
using namespace std;
template <class U, class V>
istream& operator>>(istream& in, pair<U, V>& pr) {
  return in >> pr.first >> pr.second;
}
template <class U, class V>
ostream& operator<<(ostream& out, pair<U, V>& p) {
  return out << p.first << " " << p.second;
}
template <class T>
ostream& operator<<(ostream& out, vector<T> vec) {
  for (T& e : vec) out << e << " ";
  return out << '\n';
}
void io_init() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
};
bool good(string& S) {
  vector<int> Counts(3);
  for (auto i = (0); i != (3); i++)
    Counts[i] = count(S.begin(), S.end(), (char)('a' + i));
  if (Counts[0] / 3 != Counts[1] / 3 || Counts[1] / 3 != Counts[2] / 3)
    return false;
  return Counts[0] % 3 != 2 && Counts[1] % 3 != 2 && Counts[2] % 3 != 2;
};
void solveSingleCase(int caseNo) {
  string S;
  cin >> S;
  cout << (good(S) ? "YES" : "NO") << '\n';
};
int main(int argc, char** argv) {
  io_init();
  int T = 1;
  for (auto tcase = (1); tcase != (T + 1); tcase++) {
    solveSingleCase(tcase);
  }
  return 0;
};
