#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string temp = s;
  sort(temp.begin(), temp.end());
  if (s != temp) return cout << "NO", 0;
  int a = 0, b = 0, c = 0;
  for (char x : s) {
    if (x == 'a')
      a++;
    else if (x == 'c')
      c++;
    else
      b++;
  }
  if ((c == a || c == b) && c > 0 && a > 0 && b > 0)
    cout << "YES";
  else
    cout << "NO";
}
