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