#include <bits/stdc++.h>
using namespace std;
int cnt[3];
int main() {
  string s;
  cin >> s;
  int n = (int)s.size();
  bool ok = 0;
  string t = "";
  map<char, int> m;
  int i = 0;
  while (s[i] == 'a' && i < n) i++;
  while (s[i] == 'b' && i < n) i++;
  while (s[i] == 'c' && i < n) i++;
  --i;
  int j = i;
  for (int i = 0; i < n; i++) {
    if (!m[s[i]]) {
      m[s[i]]++;
      t += s[i];
    }
    if (s[i] == 'a') cnt[0]++;
    if (s[i] == 'b' && cnt[0]) cnt[1]++;
    if (s[i] == 'c' && cnt[1]) cnt[2]++;
  }
  if (cnt[2] == cnt[0] || cnt[2] == cnt[1]) ok = 1;
  if (t != "abc") ok = 0;
  if (j != n - 1) ok = 0;
  cout << (ok ? "YES" : "NO");
}
