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