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