#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  map<char, int> m;
  for (auto it : s) m[it]++;
  if ((m['a'] - 1 == m['b'] && m['b'] == m['c']) ||
      (m['b'] - 1 == m['a'] && m['a'] == m['c']) ||
      (m['c'] - 1 == m['a'] && m['a'] == m['b']) ||
      (m['a'] + 1 == m['b'] && m['b'] == m['c']) ||
      (m['b'] + 1 == m['a'] && m['a'] == m['c']) ||
      (m['c'] + 1 == m['a'] && m['a'] == m['b']))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
