#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const double eps = 1e-6;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e2 + 10;
const int maxm = 1e5 + 10;
int main(int argc, char const *argv[]) {
  string s;
  cin >> s;
  int i = 0;
  int numa = 0, numb = 0, numc = 0;
  while (s[i] == 'a') {
    numa++;
    i++;
  }
  while (s[i] == 'b') {
    numb++;
    i++;
  }
  while (s[i] == 'c') {
    numc++;
    i++;
  }
  if (numa && numb && i == s.size() && (numc == numa || numc == numb))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
