#include <bits/stdc++.h>
using namespace std;
int nxi() {
  int a;
  cin >> a;
  return a;
}
vector<long long> a;
void inc(int i, long long v) {
  for (; i < a.size(); i |= i + 1) {
    a[i] = max(a[i], v);
  }
}
long long get(int r) {
  long long ans = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) {
    ans = max(ans, a[r]);
  }
  return ans;
}
long long get(int l, int r) { return get(r) - get(l - 1); }
int gcd(int a, int b) { return a == 0 ? b : gcd(b % a, a); }
const int mod = 1000000007;
int main() {
  string s;
  cin >> s;
  vector<int> cnt(3);
  bool ok = s[0] == 'a';
  cnt[0]++;
  int state = 0;
  for (int i = 1; i < s.length(); ++i) {
    cnt[s[i] - 'a']++;
    if (state == 0 && s[i] == 'a') continue;
    if (state == 1 && s[i] == 'b') continue;
    if (state == 2 && s[i] == 'c') continue;
    if (state == 0 && s[i] == 'b')
      state = 1;
    else if (state == 1 && s[i] == 'c')
      state = 2;
    else
      ok = false;
  }
  ok &= state == 2;
  ok &= cnt[2] == cnt[0] || cnt[2] == cnt[1];
  cout << (ok ? "YES" : "NO");
  return 0;
}
