#include <bits/stdc++.h>
using namespace std;
string s;
map<char, long long> dict;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  for (int i = 0; i <= (int)s.size() - 1; i++) {
    dict[s[i]]++;
  }
  if (dict['a'] == 0 || dict['b'] == 0 || dict['c'] == 0) {
    cout << "NO";
    return 0;
  }
  long long i = 0;
  while (s[i] == 'a') {
    dict[s[i]]--;
    i++;
  }
  if (dict['a'] != 0) {
    cout << "NO";
    return 0;
  }
  dict['a'] = i;
  while (s[i] == 'b') {
    dict['b']--;
    i++;
  }
  if (dict['b'] != 0) {
    cout << "NO";
    return 0;
  }
  dict['b'] = i - dict['a'];
  if (dict['a'] == dict['c'] ||
      dict['b'] == dict['c'] && dict['a'] > 0 && dict['b'] > 0) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
