#include <bits/stdc++.h>
using std::abs;
using std::array;
using std::cerr;
using std::cin;
using std::cout;
using std::generate;
using std::make_pair;
using std::map;
using std::max;
using std::max_element;
using std::min;
using std::min_element;
using std::pair;
using std::reverse;
using std::set;
using std::sort;
using std::string;
using std::unique;
using std::vector;
template <typename T>
T input() {
  T res;
  cin >> res;
  {};
  return res;
}
template <typename IT>
void input_seq(IT b, IT e) {
  std::generate(b, e,
                input<typename std::remove_reference<decltype(*b)>::type>);
}
int main() {
  std::iostream::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  string s = input<string>();
  int a = std::count(s.begin(), s.end(), 'a');
  int b = std::count(s.begin(), s.end(), 'b');
  int c = std::count(s.begin(), s.end(), 'c');
  if ((c != a and c != b) or (c == 0) or (b == 0) or (a == 0) or
      not std::is_sorted(s.begin(), s.end())) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
  }
  return 0;
}
