#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string str;
  cin >> str;
  int i = 0, a = 0, c = 0;
  while (i < str.size() && str[i] == 'a') i++, a++;
  if (a == 0) {
    cout << "NO";
    return 0;
  }
  int b = 0;
  while (i < str.size() && str[i] == 'b') i++, b++;
  if (b == 0) {
    cout << "NO";
    return 0;
  }
  while (i < str.size() && str[i] == 'c') i++, c++;
  if (i != str.size() || (a != c && c != b)) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
