#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string ss = s;
  sort(s.begin(), s.end());
  if (s != ss)
    cout << "NO" << endl;
  else {
    int c = count(s.begin(), s.end(), 'c');
    int a = count(s.begin(), s.end(), 'a');
    int b = count(s.begin(), s.end(), 'b');
    if (a == 0 || b == 0 || c == 0)
      cout << "NO";
    else {
      if (c == a || c == b)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
