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