#include <bits/stdc++.h>
bool debug = 0;
const long long MOD = 1000000007;
const double PI = acos(-1.0);
const double eps = 1e-9;
using namespace std;
int main() {
  string s;
  int a, b, c;
  a = b = c = 0;
  cin >> s;
  while (s.back() == 'c') {
    c++;
    s.pop_back();
  }
  while (s.back() == 'b') {
    b++;
    s.pop_back();
  }
  while (s.back() == 'a') {
    a++;
    s.pop_back();
  }
  if (debug)
    cout << "a"
         << " = " << (a) << endl;
  if (debug)
    cout << "b"
         << " = " << (b) << endl;
  if (debug)
    cout << "c"
         << " = " << (c) << endl;
  if (s.size() != 0 or a == 0 or b == 0 or c == 0 or (c != a and c != b)) {
    printf("NO\n");
  } else
    printf("YES\n");
  return 0;
}
