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