#include <bits/stdc++.h>
using namespace std;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  string s;
  cin >> s;
  vector<int> cnt(3);
  for (int i = 0; i < (int)(s.size()); ++i) cnt[s[i] - 'a']++;
  string t = s;
  sort((t).begin(), (t).end());
  bool ok = s == t;
  ok &= cnt[2] == cnt[0] || cnt[2] == cnt[1];
  ok &= cnt[0] > 0 && cnt[1] > 0;
  cout << (ok ? "YES" : "NO") << '\n';
  return 0;
}
