#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ifstream fin("filename.in");
  ofstream fout("filename.out");
  string second;
  cin >> second;
  int a = 0, b = 0, c = 0;
  int cont = 0;
  for (int i = 0; i < second.length(); i++) {
    if (second[i] == 'a')
      a++;
    else if (second[i] == 'b') {
      cont = i;
      break;
    } else {
      cout << "NO" << '\n';
      return 0;
    }
  }
  for (int i = cont; i < second.length(); i++) {
    if (second[i] == 'b')
      b++;
    else if (second[i] == 'c') {
      cont = i;
      break;
    } else {
      cout << "NO" << '\n';
      return 0;
    }
  }
  for (int i = cont; i < second.length(); i++) {
    if (second[i] == 'c')
      c++;
    else {
      cout << "NO" << '\n';
      return 0;
    }
  }
  if (a < 1 || b < 1)
    cout << "NO" << '\n';
  else if (a != c && b != c)
    cout << "NO" << '\n';
  else
    cout << "YES" << '\n';
}
