#include <bits/stdc++.h>
using namespace std;
const int MODN = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int fa, la, fb, lb, fc, lc, as, bs, cs;
  bool dc, da, db;
  dc = da = db = false;
  as = bs = cs = 0;
  for (int i = 0; i < (int)s.length(); i++) {
    if (s[i] == 'a' && !da) {
      fa = i;
      da = true;
      continue;
    }
    if (s[i] == 'b' && !db) {
      fb = i;
      db = true;
      continue;
    }
    if (s[i] == 'c' && !dc) {
      fc = i;
      dc = true;
      continue;
    }
  }
  dc = da = db = false;
  for (int i = (int)s.length() - 1; i >= 0; i--) {
    if (s[i] == 'a' && !da) {
      la = i;
      da = true;
      continue;
    }
    if (s[i] == 'a') as++;
    if (s[i] == 'b' && !db) {
      lb = i;
      db = true;
      continue;
    }
    if (s[i] == 'b') bs++;
    if (s[i] == 'c' && !dc) {
      lc = i;
      dc = true;
      continue;
    }
    if (s[i] == 'c') cs++;
  }
  if ((as != cs && cs != bs) || fa != 0 || lc != (int)s.length() - 1 ||
      la > fb || la > fc || lb > fc || fc < fb || lc < fb)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
