#include <bits/stdc++.h>
using namespace std;
string s;
char cur = 'a';
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  int col[3];
  fill(col, col + 3, 0);
  for (char c : s) {
    if (c < cur) {
      cout << "NO\n";
      return 0;
    }
    cur = c;
    col[cur - 'a']++;
  }
  if (col[0] > 0 && col[1] > 0 && (col[0] == col[2] || col[1] == col[2]))
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
