#include <bits/stdc++.h>
std::string S;
int couA, couB, couC;
int main() {
  std::cin >> S;
  for (auto c : S) {
    if (c == 'a') {
      ++couA;
    }
    if (c == 'b') {
      ++couB;
    }
    if (c == 'c') {
      ++couC;
    }
  }
  if (abs(couA - couB) <= 1 && abs(couB - couC) == 0 && abs(couA - couC) == 0) {
    std::cout << "YES" << std::endl;
  } else {
    std::cout << "NO" << std::endl;
  }
  return 0;
}
