#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double eps = 1e-9;
long double pi = 3.14159265358979323846264338327950;
long double e = 2.7182818284590452353602874713527;
string s;
int lastChar(char x) {
  for (int i = ((int)(s).size()) - 1; i >= 0; i--) {
    if (s[i] == x) return i;
  }
}
int firstChar(char x) {
  for (int i = 0; i < ((int)(s).size()); i++) {
    if (s[i] == x) return i;
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s;
  vector<pair<int, int> > v;
  int ans = 0, a = 0, b = 0, c = 0;
  v.push_back({firstChar('a'), lastChar('a')});
  v.push_back({firstChar('b'), lastChar('b')});
  v.push_back({firstChar('c'), lastChar('c')});
  for (int i = 0; i < ((int)(s).size()); i++) {
    if (s[i] == 'a') a++;
    if (s[i] == 'b') b++;
    if (s[i] == 'c') c++;
  }
  if (v[0].second < v[1].first && v[1].second < v[2].first &&
      (c == a || c == b)) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
