#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int a = 0, b = 0, c = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int index;
  cin >> s;
  n = s.size();
  if (s == "" || s[0] != 'a') {
    cout << "NO" << '\n';
    return 0;
  }
  index = 0;
  while (s[index] == 'a' && index < n) {
    a++;
    index++;
  }
  if (index == n) {
    cout << "NO" << '\n';
    return 0;
  }
  while (s[index] == 'b' && index < n) {
    b++;
    index++;
  }
  if (index == n) {
    cout << "NO" << '\n';
    return 0;
  }
  while (s[index] == 'c' && index < n) {
    c++;
    index++;
  }
  if (index != n) {
    cout << "NO" << '\n';
    return 0;
  }
  if ((c != a && c != b) || a == 0 || b == 0 || c == 0)
    cout << "NO" << '\n';
  else
    cout << "YES" << '\n';
}
