#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s[0] == 'a') {
    int aa = 0, bb = 0, cc = 0, i = 0;
    bool flag = true;
    while (s[i] == 'a' && i < s.length()) {
      aa++;
      i++;
    }
    if (s[i] != 'b') flag = false;
    while (s[i] == 'b' && i < s.length() && flag == true) {
      bb++;
      i++;
    }
    if (s[i] != 'c') flag = false;
    while (s[i] == 'c' && i < s.length() && flag == true) {
      cc++;
      i++;
    }
    if (i != s.length()) flag = false;
    if (flag) {
      if (aa != 0 && bb != 0 && cc != 0 && (cc == aa || cc == bb))
        cout << "YES\n";
      else
        cout << "NO\n";
    } else {
      cout << "NO\n";
    }
  } else
    cout << "NO\n";
  return 0;
}
