#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printvec(vector<T>& vec) {
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
int main() {
  string s;
  cin >> s;
  long long int flag = 0;
  long long int arr[3];
  arr[0] = 0;
  arr[1] = 0;
  arr[2] = 0;
  long long int prev = -1;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] - 'a' >= prev) {
      arr[s[i] - 'a']++;
      prev = s[i] - 'a';
    } else {
      cout << "NO\n";
      return 0;
    }
  }
  if (arr[0] == 0 || arr[1] == 0) {
    cout << "NO\n";
    return 0;
  }
  if (arr[2] != arr[0] && arr[2] != arr[1]) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
}
