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