#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e, f, i;
string s;
map<char, int> mp;
int main() {
  mp['a'] = 0;
  mp['b'] = 0;
  mp['c'] = 0;
  getline(cin, s);
  int n = s.size();
  for (i = 0; i != n; i++) {
    mp[s[i]]++;
  }
  for (i = 0; i != n; i++) {
    if (s[i] == 'a') {
      a = 1;
    } else {
      break;
    }
  }
  for (; i != n; i++) {
    if (s[i] == 'b') {
      b = 1;
    } else {
      break;
    }
  }
  for (; i != n; i++) {
    if (s[i] == 'c') {
      c = 1;
    } else
      break;
  }
  if ((mp['c'] != mp['a'] && mp['c'] != mp['b']) || !a || !b || !c || i != n) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  return 0;
}
