#include <bits/stdc++.h>
using namespace std;
const pair<int, int> dirs[4] = {make_pair(1, 1), make_pair(1, -1),
                                make_pair(-1, 1), make_pair(-1, -1)},
                     dir[4] = {make_pair(1, 0), make_pair(-1, 0),
                               make_pair(0, 1), make_pair(0, -1)};
const pair<int, int> dirk[8] = {
    make_pair(2, 1), make_pair(2, -1), make_pair(-2, 1), make_pair(-2, -1),
    make_pair(1, 2), make_pair(1, -2), make_pair(-1, 2), make_pair(-1, -2)};
const int inf = 1e9, maxn = 2e3 + 11, mod = 1e9 + 7, N = 3e5 + 20, LOG = 20;
const long double eps = 1e-12, pi = 3.14159265359;
const pair<unsigned long long, unsigned long long> base = make_pair(127, 137);
const long long INF = 1e18;
string second;
int main() {
  cin >> second;
  int cnta = 0, cntb = 0, cntc = 0;
  for (int i = 0; i < second.size() && second[i] == 'a'; ++i) cnta++;
  for (int i = cnta; i < second.size() && second[i] == 'b'; ++i) cntb++;
  for (int i = cnta + cntb; i < second.size() && second[i] == 'c'; ++i) cntc++;
  if (cnta + cntc + cntb == second.size() && cnta > 0 && cntb > 0 && cntc > 0 &&
      (cnta == cntc || cntb == cntc))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
