#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i, j, a = 0, b = 0, c = 0;
  if (s[0] != 'a') {
    cout << "NO";
    return 0;
  }
  for (i = 0; i < s.size(); i++) {
    if (s[i] != 'a')
      break;
    else
      a++;
  }
  if (s[i] != 'b') {
    cout << "NO";
    return 0;
  }
  for (; i < s.size(); i++) {
    if (s[i] != 'b')
      break;
    else
      b++;
  }
  for (; i < s.size(); i++) {
    if (s[i] != 'c')
      break;
    else
      c++;
  }
  if (i < s.size()) {
    cout << "NO";
    return 0;
  }
  if (c == a || c == b) {
    cout << "YES";
    return 0;
  } else
    cout << "NO";
  return 0;
}
