#include <bits/stdc++.h>
using namespace std;
string s;
int a[5], flag, i, L, R, n;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (cin >> s, n = s.size(), i = 0; i < n; ++i) a[s[i] - 'a']++;
  if (s[0] != 'a' || s[n - 1] != 'c')
    flag = false;
  else {
    for (L = 0; s[L] == 'a'; L++)
      ;
    for (R = n - 1; s[R] == 'c'; R--)
      ;
    if (a[1] == (R - L + 1) && (a[0] == a[2] || a[1] == a[2]) && a[1] >= 1 &&
        a[0] >= 1)
      flag = true;
    else
      flag = false;
  }
  cout << (flag ? "YES" : "NO") << endl;
  return 0;
}
