#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  bool fg = true;
  map<char, int> m;
  cin >> x;
  for (int i = 0; i < x.size(); i++) {
    m[x[i]]++;
    if (i > 0 && x[i] < x[i - 1]) {
      fg = false;
    }
  }
  if (fg && m['a'] > 0 && m['b'] > 0 &&
      (m['c'] == m['a'] || m['c'] == m['b'])) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
