#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, a[28] = {}, flag = 0;
  string s;
  cin >> s;
  for (i = 0; i < s.size(); i++) {
    a[s[i] - 97]++;
    if ((s[i] == 'b' && a[0] == 0) || (s[i] == 'c' && a[1] == 0)) flag = 1;
    if ((s[i] == 'a' && a[1] > 0) || (s[i] == 'b' && a[2] > 0)) flag = 1;
  }
  if ((a[0] == 0 || a[1] == 0 || a[2] == 0) || (a[0] != a[2] && a[1] != a[2]) ||
      flag == 1)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
