#include <bits/stdc++.h>
const double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
using namespace std;
void solve() {
  string s;
  cin >> s;
  int len = s.length();
  int count[3];
  memset(count, 0, sizeof(count));
  for (long long i = 0; i < len; ++i) {
    if (s[i] == 'a' && count[1] == 0 && count[2] == 0)
      ++count[0];
    else if (s[i] == 'a' && (count[1] != 0 || count[2] != 0)) {
      cout << "NO"
           << "\n";
      return;
    } else if (s[i] == 'b' && count[2] == 0)
      ++count[1];
    else if (s[i] == 'b' && count[2] != 0) {
      cout << "NO"
           << "\n";
      return;
    } else if (s[i] == 'c')
      ++count[2];
  }
  if (count[0] == 0 || count[1] == 0) {
    cout << "NO"
         << "\n";
    return;
  }
  if (count[0] == count[2] || count[1] == count[2])
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
int main() {
  bool testing = false;
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (testing) {
    freopen("test.txt", "rt", stdin);
    int start = clock();
    solve();
    int end = clock();
    cout << "time: " << (end - start) / (double)(CLOCKS_PER_SEC)*1000
         << " milliseconds\n";
  } else {
    solve();
  }
}
