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