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