#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i, as = INT_MAX, ae = INT_MIN, bs = INT_MAX, be = INT_MIN, cs = INT_MAX,
         ce = INT_MIN;
  int ca = 0, cb = 0, cc = 0;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'a') {
      ca++;
      if (i < as) as = i;
      if (i > ae) ae = i;
    } else if (s[i] == 'b') {
      cb++;
      if (i < bs) bs = i;
      if (i > be) be = i;
    } else if (s[i] == 'c') {
      cc++;
      if (i < cs) cs = i;
      if (i > ce) ce = i;
    }
  }
  if (as <= ae && ae < bs && bs <= be && be < cs && cs <= ce &&
      (ca == cc || cb == cc))
    cout << "YES\n";
  else
    cout << "NO\n";
}
