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