#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 5e6;
long long log_10(long long n) {
  long long cnt = 0;
  while (n > 0) {
    n /= 10;
    cnt++;
  }
  return cnt;
}
void NO_Exit() {
  cout << "NO" << endl;
  exit(0);
}
void NO() { cout << "NO" << endl; }
void YES_Exit() {
  cout << "YES" << endl;
  exit(0);
}
void YES() { cout << "YES" << endl; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  long long a = count(s.begin(), s.end(), 'a'),
            b = count(s.begin(), s.end(), 'b'),
            c = count(s.begin(), s.end(), 'c');
  if (a == 0 or b == 0) NO_Exit();
  if (a != c and b != c) NO_Exit();
  bool flag = true;
  for (long long i = 0; i < s.size() - 1; i++)
    if (int(s[i] - 'a') > int(s[i + 1] - 'a')) flag = false;
  if (flag)
    YES();
  else
    NO();
  return 0;
}
