#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s, s += '!';
  int p = 0, mrka = 0, mrkb = 0, mrkc = 0;
  while (s[p] == 'a') mrka++, p++;
  if (!mrka) return cout << "NO", 0;
  while (s[p] == 'b') mrkb++, p++;
  if (!mrkb) return cout << "NO", 0;
  while (s[p] == 'c') mrkc++, p++;
  if ((mrkc != mrka && mrkc != mrkb) || s[p] != '!') return cout << "NO", 0;
  cout << "YES";
  return 0;
}
