#include <bits/stdc++.h>
using namespace std;
const int mod = int(1e9 + 7), MAXN = int(2e5 + 5);
void esc(int t) {
  cout << (t ? "YES\n" : "NO\n");
  exit(0);
}
int br[300];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  string s;
  cin >> s;
  for (int i = 0; i <= s.length() - 1; i++) {
    br[s[i]]++;
    if (i > 0 && s[i] < s[i - 1]) esc(0);
  }
  esc(br['a'] && br['b'] && (br['a'] == br['c'] || br['b'] == br['c']));
  return 0;
}
