#include <bits/stdc++.h>
using namespace std;
string s;
bool check() {
  cin >> s;
  int a = 0, b = 0, c = 0;
  int state = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (state == 0) {
      if (s[i] != 'a')
        return false;
      else
        ++a, state = 1;
    } else if (state == 1) {
      if (s[i] == 'a')
        ++a;
      else if (s[i] == 'b')
        state = 2, ++b;
      else
        return false;
    } else if (state == 2) {
      if (s[i] == 'b')
        ++b;
      else if (s[i] == 'c')
        state = 3, ++c;
      else
        return false;
    } else {
      if (s[i] == 'c')
        ++c;
      else
        return false;
    }
  }
  return state == 3 && (a == c || b == c);
}
int main() {
  if (check())
    puts("YES");
  else
    puts("NO");
}
