#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string cur = s;
  sort(cur.begin(), cur.end());
  if (cur != s) cout << "NO", exit(0);
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a') a++;
    if (s[i] == 'b') b++;
    if (s[i] == 'c') c++;
  }
  if (a == 0 || b == 0) cout << "NO", exit(0);
  if (a == c || b == c)
    cout << "YES";
  else
    cout << "NO";
}
