#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int maxn = 1e6 + 10;
template <class T>
T mymin(const T a, const T b) {
  return a < b ? a : b;
}
template <class T>
T mymax(const T a, const T b) {
  return a > b ? a : b;
}
string s;
int cnta, cntb, cntc;
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  bool visa, visb, visc;
  visa = visb = visc = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a') {
      visa = 1;
      cnta++;
      if (visb || visc) {
        cout << "NO" << endl;
        exit(0);
      }
    }
    if (s[i] == 'b') {
      visb = 1;
      cntb++;
      if (visc) {
        cout << "NO" << endl;
        exit(0);
      }
    }
    if (s[i] == 'c') {
      visc = 1;
      cntc++;
    }
  }
  if (cnta && cntb && (cntc == cnta || cntc == cntb))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
