#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  int n, m;
  int x, y, z;
  string s;
  cin >> s;
  n = s.length();
  x = 0;
  y = 0;
  z = 0;
  string ch;
  ch = s;
  sort(ch.begin(), ch.end());
  for (i = 0; i < n; i++) {
    if (ch[i] != s[i]) {
      cout << "NO";
      return 0;
    }
  }
  for (i = 0; i < n; i++) {
    if (s[i] == 'a')
      x++;
    else if (s[i] == 'b')
      y++;
    else if (s[i] == 'c')
      z++;
  }
  if (x == 0 || y == 0) {
    cout << "NO";
    return 0;
  }
  if (z == x || z == y)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
