#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a;
  b = a;
  sort(b.begin(), b.end());
  if (a == b) {
    int x = 0, y = 0, z = 0;
    for (int i = 0; i < a.length(); i++)
      if (a[i] == 'a')
        ++x;
      else if (a[i] == 'b')
        ++y;
      else
        ++z;
    if (!x || !y || !z)
      puts("NO");
    else {
      if (z == x || z == y)
        puts("YES");
      else
        puts("NO");
    }
  } else
    puts("NO");
  return 0;
}
