#include <iostream>
#include<bits/stdc++.h>

using namespace std;
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
// X.find_by_order(k) return kth element. 0 indexed.
// X.order_of_key(k) returns count of elements strictly less than k.
template<class T> using ordered_set = tree<T, null_type, greater<T>,rb_tree_tag, tree_order_statistics_node_update>;
template<class T> using ordered_multi_set = tree<T, null_type, greater_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//typedef tree<pair<long long,char>,null_type,greater<pair<long long,char>>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;
#define ll long long
void Erase(ordered_multi_set<pair<ll,char>> &s,pair<ll,char>val) {
    ll rank = s.order_of_key(val);
    auto it = s.find_by_order(rank);
    s.erase(it);
}

signed main() {
    string s;
    cin>>s;
    ll n=s.size();
    map<char,ll>mp;
    for (auto i:s)mp[i]++;
    ll ma=0;
    for (auto [x,y]:mp) {
        ma=max(ma,y);
    }
    if (ma>n-ma+1) {
        cout<<"NO";
        return 0;
    }
    priority_queue<pair<ll,char>>q;
    ordered_multi_set<pair<ll,char>>st;
    for (auto [x,y]:mp) {
       // q.push({y,x});
        st.insert({y,x});
    }
    string ans="";
    while (!st.empty()) {
        auto [x,y]=*st.begin();
        if (ans.empty()) {
            ans.push_back(y);
            Erase(st,{x,y});
            x--;
            if (x!=0) {
                st.insert({x,y});
            }
        }else {
            if (ans[(int)ans.size()-1]!=y) {
                ans.push_back(y);
                Erase(st,{x,y});
                x--;
                if (x!=0) {
                st.insert({x,y});
                }
            }else {
                Erase(st,{x,y});
                auto [c,d]=*st.begin();
                ans.push_back(d);
                Erase(st,{c,d});
                c--;
                if (c!=0) {
                    st.insert({c,d});
                }
                st.insert({x,y});
            }
        }
    }
    cout<<"YES\n";
    cout<<ans<<"\n";



    return 0;
}