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