#include <bits/stdc++.h>
using namespace std;
constexpr long long INF = 1e18;
constexpr long long MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  int n[3] = {0};
  cin >> s;
  for (int i = (0); i < (s.size()); i++) {
    n[s[i] - 'a']++;
  }
  int mi = min(n[0], min(n[1], n[2]));
  n[0] -= mi;
  n[1] -= mi;
  n[2] -= mi;
  if ((n[2] == 0 && n[0] == 1 && n[1] <= 1) ||
      (n[2] == 0 && n[0] == 0 && n[1] == 0))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
