#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ca = 0, cb = 0, cc = 0;
  int ua = -1, pb = -1, ub = -1, pc = -1;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (s[i] == 'a') {
      ca++;
      ua = i;
    } else {
      if (s[i] == 'b') {
        cb++;
        ub = i;
        if (pb == -1) {
          pb = i;
        }
      } else {
        cc++;
        if (pc == -1) {
          pc = i;
        }
      }
    }
  }
  if (ca && cb && cc && ua < pb && ub < pc && (cc == ca || cc == cb)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
