#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  int a = 0;
  while (a < n && s[a] == 'a') a++;
  int b = a;
  while (b < n && s[b] == 'b') b++;
  int c = b;
  while (c < n && s[c] == 'c') c++;
  c -= b;
  b -= a;
  if (a + b + c != n || a == 0 || b == 0 || (a != c && b != c))
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
