#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ca = 0, cb = 0, cc = 0;
  int i = 0;
  int n = s.size();
  while (i < n && s[i] == 'a') {
    i++;
    ca++;
  }
  while (i < n && s[i] == 'b') {
    i++;
    cb++;
  }
  while (i < n && s[i] == 'c') {
    i++;
    cc++;
  }
  if (ca > 0 && cb > 0 && (cc == ca || cc == cb) && ca + cb + cc == n)
    cout << "YES\n";
  else
    cout << "NO\n";
}
