//Bismillah

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mid(l,r) ((r+l)/2)
#define left(node) (node*2)
#define right(node) (node*2+1)
#define mx_int_prime 999999937

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}

bitset<10001>seive;
vi prime;

void seiveGen(int limit) {
    int sqrtn = sqrt(limit);
    for(int i = 3; i <= sqrtn; i += 2) {
            if(!seive[i]) {
                    for(int j = i*i ; j <=limit; j += i + i) {
                            seive[j] = 1;
                    }
            }
    }

    prime.PB(2);
    for(int i = 3; i <= limit; i += 2) {
            if(!seive[i]) prime.PB(i);
    }
}
int ans[26];
int main()
{
    optimize();
    char st[1001];
    scanf("%s",st+1);
    int l=strlen(st+1);
    seiveGen(l/2);
    int mx=0;
    char ch;
    for(int i=1;i<=l;i++){
        int k=st[i]-'a';
        if((++ans[k])>mx) mx=ans[k],ch=st[i];
    }

    if(l<=3){
        cout<<"YES"<<endl;
        for(int i=1;i<=l;i++) cout<<st[i];
        return 0;
    }
    int k2=upper_bound(all(prime),l/2)-prime.begin();

    int lR=l/2;
    if(k2>0) lR+=(k2-1);
    if(mx>=(lR)) cout<<"YES"<<endl;
    else return cout<<"NO"<<endl , 0;
    queue<char>q;
    for(int i=1;i<=l;i++){
        if((i&1)!=1){
            if(st[i]!=ch){
                q.push(st[i]);
                st[i]=ch;
            }
        }
    }

    for(int i=1;i<k2;i++){
        if(st[prime[i]]!=ch){
            q.push(st[prime[i]]);
            st[prime[i]]=ch;
        }
    }

    for(int i=1;i<=l;i++){
        if(i&1  && !binary_search(all(prime),i)){
            if(st[i]==ch){
                if(!q.empty()){
                    char c=q.front();
                    q.pop();
                    st[i]=c;
                }else break;
            }
        }
    }

    for(int i=1;i<=l;i++) cout<<st[i];
    return 0;
}


//Bismillah

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mid(l,r) ((r+l)/2)
#define left(node) (node*2)
#define right(node) (node*2+1)
#define mx_int_prime 999999937

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}

bitset<10001>seive;
vi prime;

void seiveGen(int limit) {
    int sqrtn = sqrt(limit);
    for(int i = 3; i <= sqrtn; i += 2) {
            if(!seive[i]) {
                    for(int j = i*i ; j <=limit; j += i + i) {
                            seive[j] = 1;
                    }
            }
    }

    prime.PB(2);
    for(int i = 3; i <= limit; i += 2) {
            if(!seive[i]) prime.PB(i);
    }
}
int ans[26];
int main()
{
    optimize();
    char st[1001];
    scanf("%s",st+1);
    int l=strlen(st+1);
    seiveGen(l);
    int mx=0;
    char ch;
    for(int i=1;i<=l;i++){
        int k=st[i]-'a';
        if((++ans[k])>mx) mx=ans[k],ch=st[i];
    }

    if(l<=3){
        cout<<"YES"<<endl;
        for(int i=1;i<=l;i++) cout<<st[i];
        return 0;
    }
    int k2=upper_bound(all(prime),l)-prime.begin();

    int lR=l/2;
    if(k2>0) lR+=(k2-1);
   // dbg(prime);
   // dbg(l,k2,lR,mx,ch);
    if(mx>=(lR)) cout<<"YES"<<endl;
    else return cout<<"NO"<<endl , 0;

    queue<char>q;
    for(int i=1;i<=l;i++){
        if((i&1)!=1){
            if(st[i]!=ch){
                q.push(st[i]);
                st[i]=ch;
            }
        }
    }

    for(int i=1;i<k2;i++){
        if(st[prime[i]]!=ch){
            q.push(st[prime[i]]);
            st[prime[i]]=ch;
        }
    }

    for(int i=1;i<=l;i++){
        if(i&1  && !binary_search(all(prime),i)){
            if(st[i]==ch){
                if(!q.empty()){
                    char c=q.front();
                    q.pop();
                    st[i]=c;
                }else break;
            }
        }
    }

    for(int i=1;i<=l;i++) cout<<st[i];
    return 0;
}


//Bismillah

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mid(l,r) ((r+l)/2)
#define left(node) (node*2)
#define right(node) (node*2+1)
#define mx_int_prime 999999937

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}

bool vis[1001];
int ans[26];
int main()
{
    optimize();
    char st[1002];
    scanf("%s",st+1);
    int l=strlen(st+1),cnt=0;
    for(int i=3;i<=(l/2);i+=2){
        if(!vis[i]){
            vis[i]=1;
            cnt++;
            for(int j=i*i;j<=l;j+=i) if(!vis[j]) vis[j]=1,cnt++;
        }
    }
    int mx=0;
    char ch;
    for(int i=1;i<=l;i++){
        if(++ans[st[i]-'a'] > mx) mx=ans[st[i]-'a'],ch=st[i];
    }
    for(int i=2;i<=l;i+=2){
        if(!vis[i]) vis[i]=1 , cnt++;
    }
    if(mx>=cnt){
        cout<<"YES"<<endl;
        queue<char>q;
        for(int i=1;i<=l;i++){
            if(vis[i] && st[i]!=ch){
                q.push(st[i]);
                st[i]=ch;
            }
        }
        for(int i=1;i<=l;i++){
            if(!q.empty() && !vis[i] && st[i]==ch){
                char c=q.front();
                q.pop();
                st[i]=c;
            }
            if(q.empty()) break;
        }
        for(int i=1;i<=l;i++) cout<<st[i];
    }else cout<<"NO"<<endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
const int N = 1e3 + 6  , M = 2e5 + 5 , OO = 0x3f3f3f3f;
int cnt[30] , n , f = 1;
int ans[N];
void solve(){
    for(int i =  2 ;f &&  i <=  n ; ++i){
        int to_add = -1;
        if(ans[i] == -1){
        for(int j = 2 * i ; j <= n ; j+=i){
            if(ans[j]!=-1){
                to_add = ans[j];
            }
        }
        if(to_add == -1){
            int maxi = 0 ;
            for(int k = 0 ; k < 26 ; ++k){
                if(cnt[k] > maxi){
                    maxi = cnt[k];
                    to_add = k ;
                }
            }

                int c = 0;
                for(int k = i ; k <= n ; k+=i){
                    if(ans[k]==-1) c++;
                    ans[k] = to_add;
                }
                cnt[to_add]-=c;
                if(cnt[to_add] < 0){
                f = 0;
               // cout << i << endl;
                break;
                }

        }
        else{
                int c = 0;
                 for(int k = i ; k <= n ; k+=i){
                    if(ans[k] == -1) c++;
                    ans[k] = to_add;
                 }
                 cnt[to_add]-=c;
                 if(cnt[to_add] < 0){
                f = 0;
               // cout << i << endl;
                break;
                }

        }
    }
    }
}
int main()
{   ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    memset(ans , -1 , sizeof ans);
    string s ;
    cin >> s;
    n = s.size();
    for(int i = 0 ; i < (int)s.size() ; ++i){
        cnt[s[i]-'a']++;
    }
    solve();
    if(f == 0){
        cout << "NO";
        return 0;
    }
    for(int i = 1 ; i <= n ; ++i){
          if(ans[i] == -1){
            for(int j = 0 ; j < 26 ; ++j){
                if(cnt[j]){
                    cnt[j]--;
                    ans[i] = j ;
                    break;
                }
            }
          }
    }
    cout << "YES\n";
    for(int i = 1 ; i <= n ; ++i){
        cout << char(ans[i] + 'a');
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

vector<bool> is_prime(1001, true);
void sieveOfErat()
{
	is_prime[0] = is_prime[1] = false;
	for (int i = 2; i * i <= 1000; i++)
	{
		if (is_prime[i])
		{
			for (int j = i * i; j <= 1000; j += i)
				is_prime[j] = false;
		}
	}
}

void solve()
{
	string s; cin >> s;
	vector<int> alpha(26);
	int max_cnt = 0, pos, max_n = 1;
	for (int i = 0; i < s.length(); i++)
	{
		alpha[s[i] - 'a'] ++;
		if (max_cnt < alpha[s[i] - 'a'])
		{
			max_cnt = max(max_cnt, alpha[s[i] - 'a']);
			pos = s[i] - 'a';
		}
	}
	for (int i = s.length() / 2 + 1; i <= s.length(); i++)
		if (is_prime[i])
			max_n++;
	if (max_cnt < s.length() - max_n)
		cout << "NO" << endl;
	else
	{
		cout << "YES" << endl;
		s[0] = '-';
		for (int i = 1; i < s.length(); i++)
		{
			if (i + 1 > s.length() / 2 and is_prime[i + 1] )
				s[i] = '-';
			else
				s[i] = 'a', s[i] += pos, alpha[pos]--;
		}
		int l = 0;
		for (int i = 0; i < s.length(); i++)
		{
			if (s[i] == '-')
			{
				if (alpha[l] != 0)
					s[i] = 'a', s[i] += l, alpha[l]--;
				else
				{
					while (alpha[l] == 0)
						l++;
					s[i] = 'a', s[i] += l, alpha[l]--;
				}
			}
		}
		cout << s << endl;
	}
}

int main()
{
	int t = 1;
	// cin >> t;
	sieveOfErat();
	while (t--)
		solve();
}


#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int maxn = 1010;
const long double PI = acos(-1);

typedef long long int ll;

int qnt[30];
int n;

bool primo(int x)
{
	for(int i=2;i*i<=x;++i)
		if(x%i == 0) return false;

	return true;
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	string s;
	cin>>s;

	// s = "123456789123456";
	n = s.size();
	if(n <= 3)
	{
		cout<<"YES"<<endl<<s<<endl;
		return 0;
	}

	int repetidos = 0;
	s = " " + s;

	for(int i=1;i<=n;++i)
	{
		qnt[s[i]-'a']++;
		if((i&1))
			s[i] = '?';

	}

	for(int i=2;i<=n;++i)
	{
		if(s[i] != '.' && 2*i <= n)
		{
			int j = i;
			while(j <= n)
			{
				if(s[j] != '.')
					repetidos++;

				s[j] = '.';
				j += i;
			}
		}
	}

	int mlr = 0,pos;
	for(int i=0;i<27;++i)
		if(qnt[i] > mlr)
			mlr = qnt[i],pos = i;

	if(mlr < repetidos)
	{
		cout<<"NO"<<endl;
		return 0;
	}

	for(int i=1;i<=n;++i)
		if(s[i] == '.')
			s[i] = pos + 'a',qnt[pos]--;

	pos = 0;
	for(int i=1;i<=n;++i)
		if(s[i] == '?')
		{
			while(qnt[pos] == 0)
				pos++;
			s[i] = pos + 'a';
			qnt[pos]--;
		}

	cout<<"YES"<<endl;
	for(int i=1;i<=n;++i)
		cout<<s[i];
	cout<<endl;
}


#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int maxn = 1010;
const long double PI = acos(-1);

typedef long long int ll;

int qnt[30];
int n;

bool primo(int x)
{
	for(int i=2;i*i<=x;++i)
		if(x%i == 0) return false;

	return true;
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	string s;
	cin>>s;

	// s = "123456789123456";
	n = s.size();
	if(n <= 3)
	{
		cout<<"YES"<<endl<<s<<endl;
		return 0;
	}

	int repetidos = 1;
	s = " " + s;

	for(int i=1;i<=n;++i)
	{
		qnt[s[i]-'a']++;
		if(!(i&1))
		{
			s[i] = '.';
			repetidos++;
		}
		else
			s[i] = '?';
	}

	for(int i=3;i<=n;++i)
	{
		if(s[i] != '.' && 2*i <= n)
		{
			int j = i;
			while(j <= n)
			{
				s[j] = '.';
				repetidos++;
				j += i;
			}
		}
	}

	int mlr = 0,pos;
	for(int i=0;i<27;++i)
		if(qnt[i] > mlr)
			mlr = qnt[i],pos = i;

	if(mlr < repetidos)
	{
		cout<<"NO"<<endl;
		return 0;
	}

	for(int i=1;i<=n;++i)
		if(s[i] == '.')
			s[i] = pos + 'a',qnt[pos]--;

	pos = 0;
	for(int i=1;i<=n;++i)
		if(s[i] == '?')
		{
			while(qnt[pos] == 0)
				pos++;
			s[i] = pos + 'a';
			qnt[pos]--;
		}

	cout<<"YES"<<endl;
	for(int i=1;i<=n;++i)
		cout<<s[i];
	cout<<endl;
}


#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int maxn = 1010;
const long double PI = acos(-1);

typedef long long int ll;

int qnt[30];
int n;

bool primo(int x)
{
	for(int i=2;i*i<=x;++i)
		if(x%i == 0) return false;

	return true;
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	string s;
	cin>>s;

	// s = "123456789123456";
	n = s.size();
	if(n <= 3)
	{
		cout<<"YES"<<endl<<s<<endl;
		return 0;
	}

	int repetidos = 1;
	s = " " + s;

	for(int i=1;i<=n;++i)
	{
		qnt[s[i]-'a']++;
		if(!(i&1))
		{
			s[i] = '.';
			repetidos++;
		}
		else
			s[i] = '?';
	}

	for(int i=2;i<=n;++i)
	{
		if(s[i] != '.' && 2*i <= n)
		{
			int j = i;
			while(j <= n)
			{
				if(s[j] != '.')
					repetidos++;

				s[j] = '.';
				j += i;
			}
		}
	}

	int mlr = 0,pos;
	for(int i=0;i<27;++i)
		if(qnt[i] > mlr)
			mlr = qnt[i],pos = i;

	if(mlr < repetidos)
	{
		cout<<"NO"<<endl;
		return 0;
	}

	for(int i=1;i<=n;++i)
		if(s[i] == '.')
			s[i] = pos + 'a',qnt[pos]--;

	pos = 0;
	for(int i=1;i<=n;++i)
		if(s[i] == '?')
		{
			while(qnt[pos] == 0)
				pos++;
			s[i] = pos + 'a';
			qnt[pos]--;
		}

	cout<<"YES"<<endl;
	for(int i=1;i<=n;++i)
		cout<<s[i];
	cout<<endl;
}


#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int maxn = 1010;
const long double PI = acos(-1);

typedef long long int ll;

int qnt[30];
int n;

bool primo(int x)
{
	for(int i=2;i*i<=x;++i)
		if(x%i == 0) return false;

	return true;
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	string s;
	cin>>s;

	// s = "123456789123456";
	n = s.size();
	if(n <= 3)
	{
		cout<<"YES"<<endl<<s<<endl;
		return 0;
	}

	int repetidos = 1;
	s = " " + s;

	for(int i=1;i<=n;++i)
	{
		qnt[s[i]-'a']++;
		if(!(i&1))
		{
			s[i] = '.';
			repetidos++;
		}
		else
			s[i] = '?';
	}

	for(int i=3;i<=n;++i)
	{
		if(s[i] != '.' && 2*i <= n)
		{
			int j = i;
			while(j <= n)
			{
				s[j] = '.';
				repetidos++;
				j += i;
			}
		}
	}

	int mlr = 0,pos;
	for(int i=0;i<27;++i)
		if(qnt[i] > mlr)
			mlr = qnt[i],pos = i;

	if(mlr < repetidos)
	{
		cout<<"NO"<<endl;
		return 0;
	}

	for(int i=1;i<=n;++i)
		if(s[i] == '.')
			s[i] = pos + 'a',qnt[pos]--;

	pos = 0;
	for(int i=1;i<=n;++i)
		if(s[i] == '?')
		{
			while(qnt[pos] == 0)
				pos++;
			s[i] = pos + 'a';
			qnt[pos]--;
		}

	for(int i=1;i<=n;++i)
		cout<<s[i];
	cout<<endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef bitset<15>mask;
#define F first
#define FF first.first
#define FS first.second
#define S second
#define SF second.first
#define SS second.second
ll n,m,x,y,z,k,sol,sum,ans,l,r,xx,a[1000000],b[1000000],g[1000][1000];
vector<ll>v[100000];
vector<pair<ll,ll>>v1;
vector<ll>v2;
vector<pair<ll,ll>>vp;
pair<ll,pair<ll,ll> >pp[1000000];
pair<ll,ll>p[1000000];
map<char,ll>ma;
string s1,s2,s;
set<pair<ll,char>>st;
char c[100000],yy;
void prim(){
    a[1]=1;
    sum=1;
    for(int i=2;i<=n;i++){
            if(a[i])continue;
           if(!a[i*2])sum++,x=sum;
           else x=a[i*2];
           a[i]=x;
        for(int q=i*2;q<=n;q+=i){
            a[q]=x;
        }
    }
  return ;
}
int main()
{
//freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    cin>>s;
    n=s.size();
      prim();
    for(int i=0;i<n;i++)
        ma[s[i]]++;
    for(int i=1;i<=n;i++)
        v[a[i]].push_back(i);
    for(int i=1;i<=sum;i++){
        v1.push_back({v[i].size(),i});
       // cout<<v[i].size()<<" "<<i<<endl;
    }
    for(auto i:ma)st.insert({i.S,i.F});
   // cout<<st.size()<<endl;
    for(int i=0;i<v1.size();i++){
        x=v1[i].F,y=v1[i].S;
        auto it = st.end();
        it--;
        xx=(*it).F,yy=(*it).S;
      //  cout<<yy<<endl;
        if(xx<x){
            cout<<"NO"<<endl;
            return 0;
        }
        xx-=x;
        for(auto q:v[y]){
            c[q]=yy;
          //  cout<<yy<<" "<<i<<endl;
        }
        st.erase(it);
        st.insert({xx,yy});
    }
    cout<<"YES"<<endl;
    for(int i=1;i<=n;i++)cout<<c[i];

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef bitset<15>mask;
#define F first
#define FF first.first
#define FS first.second
#define S second
#define SF second.first
#define SS second.second
ll n,m,x,y,z,k,sol,sum,ans,l,r,xx,a[1000000],b[1000000],g[1000][1000];
vector<ll>v[100000];
vector<pair<ll,ll>>v1;
vector<ll>v2;
vector<pair<ll,ll>>vp;
pair<ll,pair<ll,ll> >pp[1000000];
pair<ll,ll>p[1000000];
map<char,ll>ma;
string s1,s2,s;
set<pair<ll,char>>st;
char c[100000],yy;
void prim(){
    a[1]=1;
    sum=1;
    for(int i=2;i<=n;i++){
            if(a[i])continue;
           if(!a[i*2])sum++,x=sum;
           else x=a[i*2];
           a[i]=x;
        for(int q=i*2;q<=n;q+=i){
            a[q]=x;
        }
    }
  return ;
}
int main()
{
//freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    cin>>s;
    n=s.size();
      prim();
    for(int i=0;i<n;i++)
        ma[s[i]]++;
    for(int i=1;i<=n;i++)
        v[a[i]].push_back(i);
    for(int i=1;i<=sum;i++){
        v1.push_back({v[i].size(),i});
       // cout<<v[i].size()<<" "<<i<<endl;
    }
    sort(v1.begin(),v1.end());
    reverse(v1.begin(),v1.end());
    for(auto i:ma)st.insert({i.S,i.F});
   // cout<<st.size()<<endl;
    for(int i=0;i<v1.size();i++){
        x=v1[i].F,y=v1[i].S;
        auto it = st.end();
        it--;
        xx=(*it).F,yy=(*it).S;
      //  cout<<yy<<endl;
        if(xx<x){
            cout<<"NO"<<endl;
            return 0;
        }
        xx-=x;
        for(auto q:v[y]){
            c[q]=yy;
          //  cout<<yy<<" "<<i<<endl;
        }
        st.erase(it);
        st.insert({xx,yy});
    }
    cout<<"YES"<<endl;
    for(int i=1;i<=n;i++)cout<<c[i];

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef bitset<15>mask;
#define F first
#define FF first.first
#define FS first.second
#define S second
#define SF second.first
#define SS second.second
ll n,m,x,y,z,k,sol,sum,ans,l,r,xx,yy,a[1000000],b[1000000],g[1000][1000];
vector<char>v;
vector<ll>v1;
vector<ll>v2;
vector<pair<ll,ll>>vp;
pair<ll,pair<ll,ll> >pp[1000000];
pair<ll,ll>p[1000000];
map<char,ll>ma;
string s1,s2,s;
set<ll>st;
char c[100000];
int main()
{
//freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
   cin>>s;
   for(int i=0;i<s.size();i++){
        c[i+1]='1';
    ma[s[i]]++;
   }
    v1.push_back(2);
   for(int i=3;i<=s.size();i++){
      if(i%2==0||i*2<=s.size()){
         v1.push_back(i);
      }
   }
  // cout<<v1.size();
      for(auto i:ma){
      if(i.S>=v1.size()){
            //cout<<i.F<<endl;
            while(!v1.empty()){
            c[v1.back()]=i.F;
            v1.pop_back();
            // cout<<ma[i.F]<<endl;
              ma[i.F]--;
              // cout<<ma[i.F]<<endl;
            }
      break;
      }
   }
   if(v1.size()){
     cout<<"NO"<<endl;
     return 0;
   }
   cout<<"YES"<<endl;
   for(int i=1;i<=s.size();i++)
   {
       if(c[i]=='1'){
         for(auto q:ma){
                if(q.S==0)continue;
             c[i]=q.F;
             ma[q.F]--;
             break;
         }
       }
   }
   for(int i=1;i<=s.size();i++)
    cout<<c[i];
   cout<<endl;

    return 0;
}


#include <bits/stdc++.h>
#if !defined(ONLINE_JUDGE)
#include "prettyprint.hpp"
#endif

using namespace std;

// --------------  DEBUGGING TEMPLATE FROM https://codeforces.com/blog/entry/68809   -------------- //

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}

void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// --------------   DEBUGGING TEMPLATE END   -------------- //

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;

const int dx4[4] = { +1, -1, 0, 0 };
const int dy4[4] = { 0, 0, +1, -1 };
const int dx8[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const int MOD = 1e9+7;

const int INF = 1e10;
const int N = 2e5+5;
string s;

bool check(int x){
	for(int i=2;i*i<=x;i++){
		if(x%i==0)
			return  false;
	}
	return true;
}

void solve(){

    cin>>s;
    // s='!'+s;
    int n=s.length();
    vi primes;
    for(int i=2;i<=n;i++){
    	if(check(i))
    		primes.pb(i);
    }

    map<char,int>cnt;
    for(auto x: s)
    	cnt[x]++;
    priority_queue<pair<int,char>> pq;
    for(auto x: cnt){
    	pq.push({x.se,x.fi});
    }
    // debug(n);
    vector<char> res(n,'?');
    for(int i=2;i<=n;i++){
    	if(res[i-1]!='?')
    		continue;
    	int  needed=n/i;
    	pair<int, char> x=pq.top();
    	pq.pop();
    	// debug(needed,i,x.fi);
    	if(x.fi<needed){
    		cout<<"NO\n";
    		return;
    	}
    	for(auto j=i-1;j<n;j+=i){
    		if(res[j]!='?'){
    			if(res[j]==x.se){
    				continue;
    			}else{
    				cout<<"NO\n";
    				return;
    			}
    		}
    		res[j]=x.se;
    		x.fi--;
    	}
    	if(x.fi){
    		pq.push({x.fi,x.se});
    	}
    	// cout<<res<<'\n';
    }

    for(auto &xx:res){
    	if(xx=='?'){
    		pair<int,char> x=pq.top();
    		pq.pop();
    		if(x.fi>0){
	    		x.fi--;
	    		if(x.fi){
	    			pq.push({x.fi,x.se});
	    		}
	    		xx=x.se;
    		}
    	}
    }
    while(pq.size()){
    	pair<int,char> x=pq.top();
    		pq.pop();
    		cout<<x<<'\n';
    }
    if(pq.size()){
    	cout<<"NO\n";
    	return;
    }
    cout<<"YES\n";
    for(auto x: res)
    	cout<<x;

    return;
}

int32_t main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS

    int t=1;

    while(t--)
        solve();

    return 0;
}


#include <bits/stdc++.h>
#if !defined(ONLINE_JUDGE)
#include "prettyprint.hpp"
#endif

using namespace std;

// --------------  DEBUGGING TEMPLATE FROM https://codeforces.com/blog/entry/68809   -------------- //

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}

void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// --------------   DEBUGGING TEMPLATE END   -------------- //

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;

const int dx4[4] = { +1, -1, 0, 0 };
const int dy4[4] = { 0, 0, +1, -1 };
const int dx8[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const int MOD = 1e9+7;

const int INF = 1e10;
const int N = 2e5+5;
string s;

bool check(int x){
	for(int i=2;i*i<=x;i++){
		if(x%i==0)
			return  false;
	}
	return true;
}

void solve(){

    cin>>s;
    // s='!'+s;
    int n=s.length();
    vi primes;
    for(int i=2;i<=n;i++){
    	if(check(i))
    		primes.pb(i);
    }

    map<char,int>cnt;
    for(auto x: s)
    	cnt[x]++;
    priority_queue<pair<int,char>> pq;
    for(auto x: cnt){
    	pq.push({x.se,x.fi});
    }
    // debug(n);
    vector<char> res(n,'?');
    for(int i=2;i<=n;i++){
    	if(res[i-1]!='?')
    		continue;
    	int  needed=n/i;
    	pair<int, char> x=pq.top();
    	pq.pop();
    	// debug(needed,i,x.fi);
    	if(x.fi<needed){
    		cout<<"NO\n";
    		return;
    	}
    	for(auto j=i-1;j<n;j+=i){
    		if(res[j]!='?'){
    			if(res[j]==x.se){
    				continue;
    			}else{
    				cout<<"NO\n";
    				return;
    			}
    		}
    		res[j]=x.se;
    		x.fi--;
    	}
    	if(x.fi){
    		pq.push({x.fi,x.se});
    	}
    	// cout<<res<<'\n';
    }

    for(auto &xx:res){
    	if(xx=='?'){
    		pair<int,char> x=pq.top();
    		pq.pop();
    		if(x.fi>0){
	    		x.fi--;
	    		if(x.fi){
	    			pq.push({x.fi,x.se});
	    		}
	    		xx=x.se;
    		}
    	}
    }

    if(pq.size()){
    	cout<<"NO\n";
    	return;
    }
    cout<<"YES\n";
    for(auto x: res)
    	cout<<x;

    return;
}

int32_t main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS

    int t=1;

    while(t--)
        solve();

    return 0;
}


#include <bits/stdc++.h>
#if !defined(ONLINE_JUDGE)
#include "prettyprint.hpp"
#endif

using namespace std;

// --------------  DEBUGGING TEMPLATE FROM https://codeforces.com/blog/entry/68809   -------------- //

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}

void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// --------------   DEBUGGING TEMPLATE END   -------------- //

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;

const int dx4[4] = { +1, -1, 0, 0 };
const int dy4[4] = { 0, 0, +1, -1 };
const int dx8[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const int MOD = 1e9+7;

const int INF = 1e10;
const int N = 2e5+5;
string s;

bool check(int x){
	for(int i=2;i*i<=x;i++){
		if(x%i==0)
			return  false;
	}
	return true;
}

void solve(){

    cin>>s;
    // s='!'+s;
    int n=s.length();
    vi primes;
    for(int i=2;i<=n;i++){
    	if(check(i))
    		primes.pb(i);
    }

    map<char,int>cnt;
    for(auto x: s)
    	cnt[x]++;
    priority_queue<pair<int,char>> pq;
    for(auto x: cnt){
    	pq.push({x.se,x.fi});
    }
    vector<char> res(n,'?');
    for(int i=2;i<=n;i++){
    	if(res[i-1]!='?')
    		continue;
    	int  needed=n/i;
    	pair<int, char> x=pq.top();
    	pq.pop();
    	if(x.fi<needed){
    		cout<<"NO\n";
    		return;
    	}
    	for(auto j=i-1;j<n;j+=i){
    		res[j]=x.se;
    		x.fi--;
    	}
    	if(x.fi){
    		pq.push({x.fi,x.se});
    	}
    }
    for(auto &xx:res){
    	if(xx=='?'){
    		pair<int,char> x=pq.top();
    		pq.pop();
    		x.fi--;
    		if(x.fi){
    			pq.push({x.fi,x.se});
    		}
    		xx=x.se;
    	}
    }
    cout<<"YES\n";
    for(auto x: res)
    	cout<<x;

    return;
}

int32_t main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS

    int t=1;

    while(t--)
        solve();

    return 0;
}


#include <bits/stdc++.h>
#if !defined(ONLINE_JUDGE)
#include "prettyprint.hpp"
#endif

using namespace std;

// --------------  DEBUGGING TEMPLATE FROM https://codeforces.com/blog/entry/68809   -------------- //

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}

void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// --------------   DEBUGGING TEMPLATE END   -------------- //

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;

const int dx4[4] = { +1, -1, 0, 0 };
const int dy4[4] = { 0, 0, +1, -1 };
const int dx8[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const int MOD = 1e9+7;

const int INF = 1e10;
const int N = 2e5+5;
string s;
int n;

int parent[N];
int sz[N];

void make_set(int v) {
    parent[v] = v;
    sz[v] = 1;
}

int find_set(int v) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}

void union_sets(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (sz[a] < sz[b])
            swap(a, b);
        parent[b] = a;
        sz[a] += sz[b];
    }
}

vi divisors(int n){
    vi ans;
    for(int i=1;i*i<=n;i++){
        if(n%i==0){
        	if(i!=1)
            	ans.pb(i);
            if(n/i!=i)
                ans.pb(n/i);
        }
    }
    sort(all(ans));
    return ans;
}

void solve(){

    cin>>s;
    n=s.length();
    for(int i=0;i<=n;i++)
    	make_set(i);

    for(int i=2;i<=n;i++){
    	vi div=divisors(i);
    	for(auto x:div){
    		union_sets(i,x);
    	}
    }

    map<char,int> cnt;
    for(auto x: s)
    	cnt[x]++;

    priority_queue<pair<int,char>>pq;
    for(auto x: cnt){
    	pq.push({x.se,x.fi});
    }

    map<int,int>mp;
    priority_queue<pii>needed;
    for(int i=1;i<=n;i++){
    	if(mp.count(find_set(i)))
    		continue;
    	mp[find_set(i)]=sz[find_set(i)];
    	needed.push({mp[find_set(i)],find_set(i)});
    }
    // cout<<mp<<'\n';
    vector<char> res(n+6,'?');
    while(pq.size()){
    	pair<int,char>x=pq.top();
    	pq.pop();
    	pii xx=needed.top();
    	needed.pop();
    	// cout<<x<<" "<<xx<<'\n';
    	if(x.fi<xx.fi){
    		cout<<"NO\n";
    		return;
    	}
    	res[xx.se]=x.se;
    	x.fi-=xx.fi;
    	if(x.fi){
    		pq.push({x.fi,x.se});
    	}
    	// for(int i=0;i<n;i++){
    	// 	if(res[i]!='?')
    	// 		cout<<"HERE "<<i<<" "<<res[i]<<'\n';
    	// }
    }

    for(int i=1;i<=n;i++){
    	if(res[i]!='?')
    		continue;
    	int p=find_set(i);
    	if(p==i){
    		pair<int,char>x=pq.top();
    		pq.pop();

    		res[i]=x.se;
    		x.fi-=1;
	    	if(x.fi){
	    		pq.push({x.fi,x.se});
	    	}
    	}else{
    		res[i]=res[p];
    	}
    }

    // for(int i=0;i<n;i++){
    // 	debug(i,find_set(i));
    // })
    for(int i=1;i<=n;i++)
    	cout<<res[i];
    return;
}

int32_t main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS

    int t=1;

    while(t--)
        solve();

    return 0;
}


#include <bits/stdc++.h>
#if !defined(ONLINE_JUDGE)
#include "prettyprint.hpp"
#endif

using namespace std;

// --------------  DEBUGGING TEMPLATE FROM https://codeforces.com/blog/entry/68809   -------------- //

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}

void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// --------------   DEBUGGING TEMPLATE END   -------------- //

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;

const int dx4[4] = { +1, -1, 0, 0 };
const int dy4[4] = { 0, 0, +1, -1 };
const int dx8[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const int MOD = 1e9+7;

const int INF = 1e10;
const int N = 2e5+5;
string s;
int n;

int parent[N];
int sz[N];

void make_set(int v) {
    parent[v] = v;
    sz[v] = 1;
}

int find_set(int v) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}

void union_sets(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (sz[a] < sz[b])
            swap(a, b);
        parent[b] = a;
        sz[a] += sz[b];
    }
}

vi divisors(int n){
    vi ans;
    for(int i=1;i*i<=n;i++){
        if(n%i==0){
        	if(i!=1)
            	ans.pb(i);
            if(n/i!=i)
                ans.pb(n/i);
        }
    }
    sort(all(ans));
    return ans;
}

void solve(){

    cin>>s;
    n=s.length();
    for(int i=0;i<=n;i++)
    	make_set(i);

    for(int i=2;i<=n;i++){
    	vi div=divisors(i);
    	for(auto x:div){
    		union_sets(i,x);
    	}
    }

    map<char,int> cnt;
    for(auto x: s)
    	cnt[x]++;

    priority_queue<pair<int,char>>pq;
    for(auto x: cnt){
    	pq.push({x.se,x.fi});
    }

    map<int,int>mp;
    priority_queue<pii>needed;
    for(int i=1;i<=n;i++){
    	if(mp.count(find_set(i)))
    		continue;
    	mp[find_set(i)]=sz[find_set(i)];
    	needed.push({mp[find_set(i)],find_set(i)});
    }
    // cout<<mp<<'\n';
    vector<char> res(n+6,'?');
    while(pq.size()){
    	pair<int,char>x=pq.top();
    	pq.pop();
    	pii xx=needed.top();
    	needed.pop();
    	// cout<<x<<" "<<xx<<'\n';
    	if(x.fi<xx.fi){
    		cout<<"NO\n";
    		return;
    	}
    	res[xx.se]=x.se;
    	x.fi-=xx.fi;
    	if(x.fi){
    		pq.push({x.fi,x.se});
    	}
    	// for(int i=0;i<n;i++){
    	// 	if(res[i]!='?')
    	// 		cout<<"HERE "<<i<<" "<<res[i]<<'\n';
    	// }
    }

    for(int i=1;i<=n;i++){
    	if(res[i]!='?')
    		continue;
    	int p=find_set(i);
    	if(p==i){
    		pair<int,char>x=pq.top();
    		pq.pop();

    		res[i]=x.se;
    		x.fi-=1;
	    	if(x.fi){
	    		pq.push({x.fi,x.se});
	    	}
    	}else{
    		res[i]=res[p];
    	}
    }

    // for(int i=0;i<n;i++){
    // 	debug(i,find_set(i));
    // })
    cout<<"YES\n";
    for(int i=1;i<=n;i++)
    	cout<<res[i];
    return;
}

int32_t main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS

    int t=1;

    while(t--)
        solve();

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;
int n, f[150];
string s;
vector<int> p;
char give[1005];  // assign char to forest
bool vis[1005];
void find_primes(int x)
{  // no need for sieve constrains is cool
	for (int i = 2; i <= x; i++) {
		int sq = sqrt(i);
		bool ok = 1;
		for(int j=i+1; j<=sq; j++)
			if (i % j == 0) {
				ok = 0;
				break;
			}
		if (ok)
			p.push_back(i);
	}
	return;
}
struct djs
{
	int* p, * h, * cnt, sz;
	djs(){}
	djs(int psz)
	{
		sz = psz + 5;
		p = new int[sz];
		h = new int[sz];
		cnt = new int[sz];
		for (int i = 0; i < sz; i++) {
			p[i] = i;
			h[i] = 0;
			cnt[i] = 1;
		}
	}

	int _find(int x)
	{
		return p[x] == x ? x : _find(p[x]);
	}
	void _union(int a, int b)
	{
		int pa = _find(a), pb = _find(b);
		if (pa == pb)
			return;

		if (h[pa] > h[pb]) {
			p[pb] = pa;
			cnt[pa] += cnt[pb];
		}
		else if (h[pb] > h[pa]) {
			p[pa] = pb;
			cnt[pb] += cnt[pa];
		}
		else {
			p[pb] = pa;
			h[pa]++;
			cnt[pa] += cnt[pb];
		}

		return;
	}
};
int main()
{
	cin >> s;
	n = s.size();
	djs obj(n);
	s = "." + s; // 1 based   , if 0 based equality will miss

	// count , for assigning to forests
	for (int i = 1; i <= n; i++)
		f[s[i]]++;

	find_primes(n);

	// build forests -> positions that have to have euql chars
	for (int i = 0; i < p.size(); i++)
	{  // build the forests
		int pp = p[i];
		int lim = n / pp;
		for (int j = 1; j <= lim; j++)
		{
			int ind = j * pp;
			obj._union(pp , ind); // have to be equal
		}
	}
	//cout << "here" << endl;

	for (int i = 1; i <= n; i++)
		give[i] = s[i];

	// try to build the string  , forests  could be the primes
	for (int i = 1; i <=n; i++)
	{
		int pp = i;
		int dad = obj._find(pp);
		int cnt = obj.cnt[dad];

		if (vis[dad])
			continue;

		int best = INT_MAX;
		char x;
		for (char a = 'a'; a <= 'z'; a++)  // 26 iter
			if (f[a] >= cnt && f[a] - cnt < best) {
				best = f[a] - cnt;
				x = a;
			}

		//cout << "count is   " << cnt << endl;
		//cout << "BEST IS   " << best << endl;
		//cout << "DAD IS    " << dad << endl;

		if (best == INT_MAX)
			return cout << "NO" << endl, 0;
		vis[dad] = 1;
		give[dad] = x;
		f[x] -= cnt;
	}
	cout << "YES" << endl;
	for (int i = 1; i <= n; i++) {
		int dad = obj._find(i);
		//cout << dad << endl;
		cout << give[dad];
	}
	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int n, f[150];
string s;
vector<int> p;
char give[1005];  // assign char to forest
bool vis[1005];
void find_primes(int x)
{  // no need for sieve constrains is cool
	for (int i = 2; i <= x; i++) {
		int sq = sqrt(i);
		bool ok = 1;
		for(int j=i+1; j<=sq; j++)
			if (i % j == 0) {
				ok = 0;
				break;
			}
		if (ok)
			p.push_back(i);
	}
	return;
}
struct djs
{
	int* p, * h, * cnt, sz;
	djs(){}
	djs(int psz)
	{
		sz = psz + 5;
		p = new int[sz];
		h = new int[sz];
		cnt = new int[sz];
		for (int i = 0; i < sz; i++) {
			p[i] = i;
			h[i] = 0;
			cnt[i] = 1;
		}
	}

	int _find(int x)
	{
		return p[x] == x ? x : _find(p[x]);
	}
	void _union(int a, int b)
	{
		int pa = _find(a), pb = _find(b);
		if (pa == pb)
			return;

		if (h[pa] > h[pb]) {
			p[pb] = pa;
			cnt[pa] += cnt[pb];
		}
		else if (h[pb] > h[pa]) {
			p[pa] = pb;
			cnt[pb] += cnt[pa];
		}
		else {
			p[pb] = pa;
			h[pa]++;
			cnt[pa] += cnt[pb];
		}

		return;
	}
};
int main()
{
	cin >> s;
	n = s.size();
	djs obj(n);
	s = "." + s; // 1 based   , if 0 based equality will miss

	// count , for assigning to forests
	for (int i = 1; i <= n; i++)
		f[s[i]]++;

	find_primes(n);

	// build forests -> positions that have to have euql chars
	for (int i = 0; i < p.size(); i++)
	{  // build the forests
		int pp = p[i];
		int lim = n / pp;
		for (int j = 1; j <= lim; j++)
		{
			int ind = j * pp;
			obj._union(pp , ind); // have to be equal
		}
	}
	//cout << "here" << endl;

	for (int i = 1; i <= n; i++)
		give[i] = s[i];

	// try to build the string  , forests  could be the primes
	for (int i = 1; i <=n; i++)
	{
		int pp = i;
		int dad = obj._find(pp);
		int cnt = obj.cnt[dad];

		if (vis[dad])
			continue;

		int best = INT_MAX;
		char x;
		for (char a = 'a'; a <= 'z'; a++)  // 26 iter
			if (f[a] >= cnt && f[a] - cnt < best) {
				best = f[a] - cnt;
				x = a;
			}

		//cout << "count is   " << cnt << endl;
		//cout << "BEST IS   " << best << endl;
		//cout << "DAD IS    " << dad << endl;

		if (best == INT_MAX)
			return cout << "NO" << endl, 0;
		vis[dad] = 1;
		give[dad] = x;
		f[x] -= cnt;
	}
	cout << "YES" << endl;
	for (int i = 1; i <= n; i++) {
		int dad = obj._find(i);
		//cout << dad << endl;
		cout << give[dad];
	}
	cout << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
s.find_by_order(x) xth element in set
x.order_of_key(x) number of elements <x*/
#define ll long long
#define vi vector<int>
#define si set<int>
#define mii map<int,int>
#define pb push_back
#define pf push_front
#define PI acos(-1)
#define pii pair<int,int>
#define extract_word(s)  stringstream str(s); while(str>>word)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define SET(s) cout<<fixed<<setprecision(s)
#define set0(a) memset(a,0,sizeof(a))
#define endl "\n"
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define lower_string(s) transform(all(s),s.begin(),::tolower())
#define upper_string(s) transform(all(s),s.begin(),::toupper())
#define size(s) (int)s.size()
template<typename T,typename U>
bool compare(T x,U y){return(abs(x-y)<=1e-9);}
const int MOD=1e9+7;
void solve()
{
fastio
string s;
cin>>s;
int n=size(s);
map<char,int>mp;
int max_v=-1;
char tg;
for(auto &x:s)
{
	mp[x]++;
	if(max_v<mp[x])
	{
		max_v=mp[x];
		tg=x;
	}
}
vi sieve(n+1,1);
for(int i=2;i<=n;i++)
{
	if(sieve[i]&&(i*2<=n))
	{
		for(int j=i;j<=n;j+=i)
		sieve[j]=0;
	}
}
//1 represent prime
int count0=count(all(sieve),0);
vector<char>ans(n,'#');
if(count0<=max_v)
{
	cout<<"YES"<<endl;
for(int i=1;i<=n;i++)
{
	if(!sieve[i])
	{
		ans[i-1]=tg;
		mp[tg]--;
	}
}
for(int i=1;i<=n;i++)
{
	if(sieve[i])
	{
	for(auto &x:mp)
	{
		if(x.second)
		{
			ans[i-1]=x.first;
			mp[ans[i-1]]--;
			break;
		}
	}
	}
}
for(auto &x:ans)
cout<<x;
}
else
cout<<"NO";
}
int main()
{
//code
fastio
int t;
t=1;
while(t--)
{
solve();
cout<<endl;
}
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 1e18

string s,ans,tmp="";
vector<pair<int,char> > v;
map<char,int> m;
int prime[1005];

void sieve(){
    for(int i=2;i<=1000;i++) prime[i]=1;
    for(int i=4;i<=1000;i+=2) prime[i]=0;
    for(int i=3;i*i<=1000;i+=2){
        if(prime[i]){
            for(int j=i*i;j<=1000;j+=i) prime[j]=0;
        }
    }
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    sieve();
    cin>>s;
    for(auto i:s) m[i]++;
    for(auto i:m) v.pb({i.se,i.fi});
    sort(all(v),greater<pair<int,char> >());
    int cnt=0;
    for(int p=sz(s)/2+1;p<=sz(s);p++){
        if(prime[p]) cnt++;
    }
    if(sz(s)-cnt-1>v[0].fi){
        cout<<"NO\n";
        return 0;
    }
    ans=s;
    for(int i=0;i<sz(s);i++){
        if(s[i]!=v[0].se) tmp.pb(s[i]);
    }
    int extra = v[0].fi-sz(s)+cnt+1;
    while(extra--) tmp.pb(v[0].se);
    int idx=0;
    for(int i=0;i<sz(s);i++){
        if(!i || (i>=sz(s)/2 && prime[i+1])) ans[i]=tmp[idx++];
        else ans[i]=v[0].se;
    }
    cout<<"YES\n";
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 1e18

string s,ans,tmp="";
vector<pair<int,char> > v;
map<char,int> m;
int prime[1005];

void sieve(){
    for(int i=2;i<=1000;i++) prime[i]=1;
    for(int i=4;i<=1000;i+=2) prime[i]=0;
    for(int i=3;i*i<=1000;i+=2){
        if(prime[i]){
            for(int j=i*i;j<=1000;j+=i) prime[j]=0;
        }
    }
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    sieve();
    cin>>s;
    for(auto i:s) m[i]++;
    for(auto i:m) v.pb({i.se,i.fi});
    sort(all(v),greater<pair<int,char> >());
    int cnt=0;
    for(int p=sz(s)/2+1;p<=sz(s);p++){
        if(prime[p]) cnt++;
    }
    if(sz(s)-cnt-1>v[0].fi){
        cout<<"NO\n";
        return 0;
    }
    ans=s;
    for(int i=0;i<sz(s);i++){
        if(s[i]!=v[0].se) tmp.pb(s[i]);
    }
    int extra = v[0].fi-sz(s)+cnt+1;
    while(extra--) tmp.pb(v[0].se);
    int idx=0;
    for(int i=0;i<sz(s);i++){
        if(!i || (i>sz(s)/2 && prime[i+1])) ans[i]=tmp[idx++];
        else ans[i]=v[0].se;
    }
    cout<<"YES\n";
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 1e18

string s,ans,tmp="";
vector<pair<int,char> > v;
map<char,int> m;
int prime[1005];

void sieve(){
    for(int i=2;i<=1000;i++) prime[i]=1;
    for(int i=4;i<=1000;i+=2) prime[i]=0;
    for(int i=3;i*i<=1000;i+=2){
        if(prime[i]){
            for(int j=i*i;j<=1000;j+=i) prime[j]=0;
        }
    }
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    sieve();
    cin>>s;
    for(auto i:s) m[i]++;
    for(auto i:m) v.pb({i.se,i.fi});
    sort(all(v),greater<pair<int,char> >());
    int cnt=0;
    for(int p=sz(s)/2+1;p<=sz(s);p++){
        if(prime[p]) cnt++;
    }
    if(sz(s)-cnt-1>v[0].fi){
        cout<<"NO\n";
        return 0;
    }
    ans=s;
    for(int i=0;i<sz(s);i++){
        if(s[i]!=v[0].se) tmp.pb(s[i]);
    }
    int extra = v[0].fi-sz(s)+cnt+1;
    while(extra--) tmp.pb(v[0].se);
    int idx=0;
    for(int i=0;i<sz(s);i++){
        if(!i || (i>sz(s)/2 && prime[i+1])) ans[i]=tmp[idx++];
        else ans[i]=v[0].se;
    }
    cout<<ans;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+100;
bool vis[maxn];
int tot;
int prime[maxn];
char ans[maxn];
void eular()
{
    for(int i=2; i<=100000; ++i)
    {
        if(!vis[i])
            prime[tot++]=i;
        for(int j=0; j<tot&&prime[j]*i<=100000; ++j)
        {
            vis[prime[j]*i]=1;
            if(i%prime[j]==0)
                break;
        }
    }
}
int main()
{
    eular();
    map<int,bool>mp;
    for(int i=0; i<tot; ++i)
    {
        mp[prime[i]]=true;
    }
    string str;
    cin>>str;
    int len=str.size();
    int cnt[30]= {0};
    int mx=0;
    int key=-1;
    for(int i=0; i<len; ++i)
    {
        cnt[str[i]-'a']++;
    }
    for(int i=0; i<26; ++i)
    {
        if(cnt[i]>mx)
        {
            mx=cnt[i];
            key=i;
        }
    }
    int mk=-1;
    int cnut=0;
    for(int i=0; prime[i]<=len; ++i)
    {
        if(prime[i]*2>len)
        {
            if(mk==-1)
                mk=prime[i];
        }
    }
    //cout<<"***"<<char('a'+key)<<endl;
    bool flag=true;
    for(int i=2; i<=len; ++i)
    {
        if(mp[i]&&i>=mk)
        {
            ++cnut;
        }
        else
        {
            if(cnt[key]==0)
            {
                flag=false;
                break;
            }
            ans[i-1]=key+'a';
            --cnt[key];
        }
    }
    if(flag)
    {
        ans[len]='\n';
        int ac=0;
        for(int i=0; i<len; ++i)
        {
            if(ans[i]==0)
            {
                while(cnt[ac]==0)
                    ++ac;
                ans[i]=ac+'a';
                --cnt[ac];

            }
        }
        cout<<"YES"<<endl;
        cout<<ans<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll =long long ;
const int N=1e6+20;
const int mod=1e9+7;
int prim[N],all[N],cnt=0;
int vis[N];
int have[333];
char ss[N];
struct node
{
    int have=0;
    int c;
};
void xxs()
{
    for(int i=2; i<N; ++i)
    {
        if(all[i]==0)
        {
            vis[i]=1;
            all[i]=1;
            prim[cnt++]=i;
        }
        for(int j=0; j<cnt; ++j)
        {
            if(i*prim[j]>=N)
                break;
            all[i*prim[j]]=1;
            if(i%prim[j]==0)
                break;
        }
    }
}
bool cmp(node l1,node l2)
{
    if(l1.have==l2.have)
        return l1.c<l2.c;
    return l1.have>l2.have;
}
bool ccc(node l1,node l2)
{
    return l1.c<l2.c;
}
int main()
{
    xxs();
    while(~scanf("%s",ss))
    {
        node zm[222];
        for(int i=0; i<222; ++i)
        {
            zm[i].c=i;
            zm[i].have=0;
        }
        int len=strlen(ss);
        int NOT=1;
        for(int i=1; i<=len; ++i)
        {
            if(vis[i]&&i*2>len)
                NOT++;
            zm[ss[i-1]].have++;
        }
        sort(zm,zm+222,cmp);
        if(zm[0].have<len-NOT)
            printf("NO\n");
        else
        {
		printf("YES\n");
            sort(ss,ss+len);
            int kk=len-NOT;
            zm[0].have-=kk;
            char hhhh=zm[0].c;
            sort(zm,zm+222,ccc);
            for(int l=0,i=0; i<len; ++i)
            {
                if(vis[i+1]&&(i+1)*2>len||i==0)
                {
                    while(zm[l].have==0)
                        l++;
                    zm[l].have--;
                    printf("%c",zm[l].c);
                }
                else
                    printf("%c",hhhh);
            }
            printf("\n");
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+100;
bool vis[maxn];
int tot;
int prime[maxn];
char ans[maxn];
void eular()
{
    for(int i=2; i<=100000; ++i)
    {
        if(!vis[i])
            prime[tot++]=i;
        for(int j=0; j<tot&&prime[j]*i<=100000; ++j)
        {
            vis[prime[j]*i]=1;
            if(i%prime[j]==0)
                break;
        }
    }
}
int main()
{
    eular();
    map<int,bool>mp;
    for(int i=0; i<tot; ++i)
    {
        mp[prime[i]]=true;
    }
    string str;
    cin>>str;
    int len=str.size();
    int cnt[30]= {0};
    int mx=0;
    int key=-1;
    for(int i=0; i<len; ++i)
    {
        cnt[str[i]-'a']++;
    }
    for(int i=0; i<26; ++i)
    {
        if(cnt[i]>mx)
        {
            mx=cnt[i];
            key=i;
        }
    }
    int mk=-1;
    int cnut=0;
    for(int i=0; prime[i]<=len; ++i)
    {
        if(prime[i]*2>len)
        {
            if(mk==-1)
                mk=prime[i];
        }
    }
    bool flag=true;
    for(int i=1; i<=len; ++i)
    {
        if(mp[i]&&i>=mk)
        {
            ++cnut;
        }
        else
        {
            if(cnt[key]==0)
            {
                flag=false;
                break;
            }
            ans[i-1]=key+'a';
            --cnt[key];
        }
    }
    if(flag)
    {
        ans[len]='\n';
        int ac=0;
        for(int i=0; i<len; ++i)
        {
            if(ans[i]==0)
            {
                while(cnt[ac]==0)
                    ++ac;
                ans[i]=ac+'a';
                --cnt[ac];

            }
        }
        cout<<"YES"<<endl;
        cout<<ans<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }
    return 0;
}


	#include <bits/stdc++.h>
	using namespace std;
	#define mod 1000000007
	#define fi first
	#define se second
	#define mp make_pair
	#define pb push_back
	#define ps push
	#define ii pair<int,int>
	#define INF 1e16
	typedef long long ll;

	int main()
	{
		string s;
		cin>>s;
		vector<pair<char,ll> > v;
		vector<ll> freq(27,0);
		string s2(s.length(),'1');
		vector<ll> vis(s.length()+1,0);
		for(ll i=0;i<s.length();i++)
		{
			freq[s[i]-'a']++;
		}
		for(ll i=0;i<27;i++)
		{
			if(freq[i]>0)
				v.pb({freq[i],(char)(i+'a')});
		}
		sort(v.begin(),v.end());
		reverse(v.begin(),v.end());

		ll n=s.length();
		ll cnt=0;
		for(ll i=2;i<=n;i+=2)
		{
			vis[i]=1;
			cnt++;
		}
		for(ll i=2;i<=n;i+=1)
		{
			bool add=false;
			if(!vis[i])
			for(ll j=i;j<=n;j+=i)
			{
				if(vis[j])
					add=true;
			}
			if(!add)
				continue;
			for(ll j=i;j<=n;j+=i)
			{
				if(!vis[j])
					cnt++;
				vis[j]=1;
			}
		}
		if(v[0].fi<(cnt))
			{
				cout<<"NO";
				return 0;
			}
		ll i;
		for(i=2;i<=n;i++)
		{
			if(!vis[i])
				continue;
			s2[i-1]=v[0].se;
			v[0].fi--;
			vis[i]=1;
		}

		ll k=0;
		for(i=1;i<=n;i++)
		{
			if(!vis[i]){
			if(v[k].fi==0)
				{
					k++;
				}
				s2[i-1]=v[k].se;
				v[k].fi--;

			}

		}
		cout<<"YES\n";
		cout<<s2;
	}


	#include <bits/stdc++.h>
	using namespace std;
	#define mod 1000000007
	#define fi first
	#define se second
	#define mp make_pair
	#define pb push_back
	#define ps push
	#define ii pair<int,int>
	#define INF 1e16
	typedef long long ll;

	int main()
	{
		string s;
		cin>>s;
		vector<pair<ll,char> > v;
		vector<ll> freq(27,0);
		string s2(s.length(),'1');
		vector<ll> vis(s.length()+1,0);
		for(ll i=0;i<s.length();i++)
		{
			freq[s[i]-'a']++;
		}
		for(ll i=0;i<27;i++)
		{
			char c=i+'a';
			if(freq[i]>0)
				v.pb({freq[i],c});
		}
		sort(v.begin(),v.end());
		reverse(v.begin(),v.end());

		ll n=s.length();
		ll cnt=0;
		for(ll i=2;i<=n;i+=2)
		{
			vis[i]=1;
			cnt++;
		}
		for(ll i=2;i<=n;i+=1)
		{
			bool add=false;
			if(!vis[i])
			for(ll j=i;j<=n;j+=i)
			{
				if(vis[j])
					add=true;
			}
			if(!add)
				continue;
			for(ll j=i;j<=n;j+=i)
			{
				if(!vis[j])
					cnt++;
				vis[j]=1;
			}
		}
		//cout<<n<<" "<<cnt<<" "<<v[0].fi<<endl;
		if(v[0].fi<(cnt))
			{
				cout<<"NO";
				return 0;
			}
		ll i;
		for(i=2;i<=n;i++)
		{
			if(!vis[i])
				continue;
			s2[i-1]=v[0].se;
			v[0].fi--;
			vis[i]=1;
		}

		ll k=0;
		for(i=1;i<=n;i++)
		{
			if(!vis[i]){
			if(v[k].fi==0)
				{
					k++;
				}
				s2[i-1]=v[k].se;
				v[k].fi--;

			}

		}
		cout<<"YES\n";
		cout<<s2;
	}


//* AuThOr GaRyMr *//
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
string tmp;
vector<int> a;
bool check(int x){
	if(x==1) return false;
	for(int i=2;i*i<=x;i++){
		if(x%i==0) return false;
	}
	return true;
}
int q=0;
int c[27],k[27];
int main(){
	cin>>tmp;
	if(tmp.length()==1) {
		puts("YES");
		cout<<tmp<<endl;
		return 0;
	}
	int len=tmp.length();
	tmp='$'+tmp;
	a.PB(1);
	rb(i,(len/2)+1,len){
		if(check(i)) a.PB(i);
	}
	rb(i,1,len){
		k[tmp[i]-'a'+1]++;
	}
	rb(i,1,26) c[i]=i;
	rb(i,1,26){
		if(k[i]>k[q]) q=i;
	}
	swap(k[q],k[26]);
	swap(c[q],c[26]);
	if(k[26]<len-a.size()){
		puts("NO");
		return 0;
	}
	puts("YES");
	int w=1;
	rb(i,1,26){
		if(k[i]!=0){
			w=i;
			break;
		}
	}
	int l=0;
	rb(i,1,len){
		if(i==a[l]){
			l++;
			cout<<char('a'+c[w]-1);
			k[w]--;
			if(k[w]==0){
				rb(j,1,26){
					if(k[j]!=0){
						w=j;
						break;
					}
				}
			}
		}
		else{
			cout<<char('a'+c[26]-1);
		}
	}
	return 0;
}


//* AuThOr GaRyMr *//
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int tot[27];
vector<mp > all;
string tmp;
bool cmp(mp A,mp B) {
	return A>B;
}
int belong [1000+10];
int find(int x){
	if(belong[x]==x) return x;
	return belong[x]=find(belong[x]);
}
bool check(int x){
	for(int i=2;i*i<=x;i++){
		if(x%i==0) return false;
	}
	return true;
}
int ALL[1001];
vector<mp > all2;
int is[1001];
int main(){
	cin>>tmp;
	int len=tmp.length();
	rep(i,len) tot[tmp[i]-'a'+1]++;
	rb(i,1,26) if(tot[i]) all.PB(II(tot[i],i));
	sort(all.begin(),all.end(),cmp);
	rb(i,1,len) belong[i]=i;
	rb(i,2,len){
		if(check(i)){
			for(int j=i+i;j<=len;j+=i){
				belong[find(j)]=find(i);
			}
		}
	}
	rb(i,1,len) find(i);
	rb(i,1,len){
		ALL[belong[i]]++;
	}
	rb(i,1,len)
		{
			if(ALL[i]){
				all2.PB(II(ALL[i],i));
			}
		}
	sort(all2.begin(),all2.end(),cmp);
	rb(i,0,all2.size()-1){
		mp tmp=II(INF,INF);
		rb(j,0,all.size()-1){
			if(all[j].FIR>=all2[i].FIR){
				tmp=min(tmp,II(all[j].FIR,j));
			}
		}
		if(tmp==II(INF,INF)) {
			cout<<"NO";
			return 0;
		}
		all[tmp.SEC].FIR-=all2[i].FIR;
		is[all2[i].SEC]=all[tmp.SEC].SEC;
	}
	cout<<"YES"<<endl;
	rb(i,1,len){
		cout<<char('a'+is[belong[i]]-1);
	}
	return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag,
		tree_order_statistics_node_update> ordered_set;

#define el				'\n'
#define sz(v)			((int)((v).size()))
#define all(v)          ((v).begin()),((v).end())
#define clr(v, d)		memset(v, d, sizeof(v))

double const EPS = 1e-8, PI = acos(-1);
const int N = 100 + 9, M = 1e5 + 9, OO = (int) 1e9 + 1;
const long long MOD = 1e9 + 7, INF = 1e13 + 9;

typedef long long ll;

void OUTPUT() {
	cout << fixed << setprecision(0);
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}

void INPUT() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
}

string str;
int n, freq[30];

map<int, bool> dif;
vector<pair<int, char>> occur;

bool isPrime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)
			return 0;
	}
	return 1;
}

bool cmp(pair<int, char> a, pair<int, char> b) {
	return a.first > b.first;
}

int main() {
	INPUT();
	OUTPUT();
	cin >> str;
	n = sz(str);
	dif[1] = 1;

	for (int i = 2; i <= n; i++) {
		if (isPrime(i) && n < i * 2)
			dif[i] = 1;
	}

	for (int i = 0; i < n; i++)
		freq[str[i] - 'a']++;

	for (int i = 0; i < 30; i++) {
		if (freq[i] > 0)
			occur.push_back( { freq[i], 'a' + i });
	}

	sort(occur.begin(), occur.end(), cmp);
	int j = sz(occur) - 1;

	if (occur[0].first < n - sz(dif))
		cout << "NO\n";
	else {
		vector<char> v(n);
		for (int i = 0; i < n; i++) {
			if (!dif[i + 1]) {
				v[i] = occur[0].second;
				occur[0].first--;
			}

			else {
				v[i] = occur[j].second;
				occur[j].first--;
				if (occur[j].first == 0)
					j--;
			}
		}
		cout<<"YES\n";
		for (int i = 0; i < n; i++)
			cout << v[i];

	}
	return 0;

}


#include<bits/stdc++.h>

using namespace std;
pair<int,int> a[30];
vector<int>v[1005];
bool visit[1005];
int cnt=0;
vector<int>G[1005];
int ans[1005];
vector<pair<int,int> >mp;
bool prime(int x){
	if(x==1)return 0;
	for(int i=2;i*i<=x;i++){
		if(x%i==0)return false;
	}
	return true;
}
void dfs(int x){
	G[cnt].push_back(x);
	visit[x]=1;
	for(int i=0;i<v[x].size();i++){
		if(!visit[v[x][i]]){
			dfs(v[x][i]);
		}
	}
}
map<int,int>lp;
int main(){
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		a[s[i]-'a'].first++;
		a[s[i]-'a'].second=s[i]-'a';
	}
//	for(int i=0;i<26;i++)cout<<a[i].first<<" "<<a[i].second<<endl;
	for(int i=1;i<=s.size();i++){
		if(prime(i)){
			int t=1;
			while(i*t<=s.size()){
				v[i].push_back(i*t);
				v[i*t].push_back(i);
				t++;
			}
		}
	}
//	for(int i=0;i<26;i++)cout<<a[i].first<<" "<<a[i].second<<endl;
	for(int i=1;i<=s.size();i++){
		if(!visit[i]){
			dfs(i);
			cnt++;
		}
	}
/*	for(int i=0;i<s.size();i++){
		for(int j=0;j<G[i].size();j++)cout<<G[i][j]<<" ";
		cout<<endl;
	}*/
	sort(a,a+26);
	reverse(a,a+26);
	for(int i=0;i<cnt;i++){
		mp.push_back(make_pair(G[i].size(),i));
	}
	bool f=1;
	sort(mp.begin(),mp.end());
	reverse(mp.begin(),mp.end());
	for(int i=0;i<s.size();i++)ans[i]=100;
	for(int i=0;i<mp.size();i++){
//		cout<<mp[i].first<<" "<<a[i].first<<" "<<a[i].second<<endl;
		if(mp[i].first<=a[0].first){
			a[0].first-=mp[i].first;
			for(int j=0;j<G[mp[i].second].size();j++){
				ans[G[mp[i].second][j]-1]=a[0].second;
			}
		}
		sort(a,a+26);
		reverse(a,a+26);
	}
	for(int i=0;i<s.size();i++){
		if(ans[i]==100){
			for(int j=0;j<=26;j++){
				if(a[j].first!=0){
					a[j].first--;
					ans[i]=a[j].second;
				}
			}
		}
	}
	for(int i=0;i<s.size();i++){
		if(ans[i]==100){
//			cout<<i<<endl;
			f=0;
		}
	}
	if(!f){
		cout<<"NO"<<endl;
		return 0;
	}
	else cout<<"YES"<<endl;
	for(int i=0;i<s.size();i++){
//		cout<<ans[i]<<" ";
		putchar(ans[i]+'a');
	}
	return 0;
}
/*
qqqqqqqqqqqqqqqqqqqqzqqqzqqqqqqqqqqqqqzqqqqqqqqcqqzqqqqqzqqqqqqqqqqqq
*/


#include<bits/stdc++.h>

using namespace std;
pair<int,int> a[30];
vector<int>v[1005];
bool visit[1005];
int cnt=0;
vector<int>G[1005];
int ans[1005];
vector<pair<int,int> >mp;
bool prime(int x){
	if(x==1)return 0;
	for(int i=2;i*i<=x;i++){
		if(x%i==0)return false;
	}
	return true;
}
void dfs(int x){
	G[cnt].push_back(x);
	visit[x]=1;
	for(int i=0;i<v[x].size();i++){
		if(!visit[v[x][i]]){
			dfs(v[x][i]);
		}
	}
}
map<int,int>lp;
int main(){
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		a[s[i]-'a'].first++;
		a[s[i]-'a'].second=s[i]-'a';
	}
	for(int i=1;i<=s.size();i++){
		if(prime(i)){
			int t=1;
			while(i*t<=s.size()){
				v[i].push_back(i*t);
				v[i*t].push_back(i);
				t++;
			}
		}
	}
//	for(int i=0;i<26;i++)cout<<a[i].first<<" "<<a[i].second<<endl;
	for(int i=1;i<=s.size();i++){
		if(!visit[i]){
			dfs(i);
			cnt++;
		}
	}
	sort(a,a+26);
	reverse(a,a+26);
	for(int i=0;i<cnt;i++){
		mp.push_back(make_pair(G[i].size(),i));
	}
	bool f=1;
	sort(mp.begin(),mp.end());
	reverse(mp.begin(),mp.end());
	for(int i=0;i<s.size();i++)ans[i]=100;
	for(int i=0;i<mp.size();i++){
//		cout<<mp[i].first<<" "<<a[i].first<<" "<<a[i].second<<endl;
		if(mp[i].first<=a[i].first){
			a[i].first-=mp[i].first;
			for(int j=0;j<G[mp[i].second].size();j++){
				ans[G[mp[i].second][j]-1]=a[i].second;
			}
		}
	}
	for(int i=0;i<s.size();i++){
		if(ans[i]==100){
			for(int j=0;j<=26;j++){
				if(a[j].first!=0){
					a[j].first--;
					ans[i]=a[j].second;
				}
			}
		}
	}
	for(int i=0;i<s.size();i++){
		if(ans[i]==100){
			f=0;
		}
	}
	if(!f){
		cout<<"NO"<<endl;
		return 0;
	}
	else cout<<"YES"<<endl;
	for(int i=0;i<s.size();i++){
//		cout<<ans[i]<<" ";
		putchar(ans[i]+'a');
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define pragi(a,b) for(ll i = a;i<b;i++)
#define pragj(a,b) for(ll j = a;j<b;j++)
#define pragk(a,b) for(ll k = a;k>=b;k--)
#define all(v) (v.begin(),v.end())
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define MP make_pair
#define MT make_tuple
#define F first
#define S second
#define KAKA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const int mod = 1e9 + 7;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef long double ld;
typedef pair<int, int> pii;
//typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef pair<ll, ll> pll;
ll parent[100005];
ll R[100005];
void MakeSet(ll i)
{
 parent[i] = -1;
 R[i] = 1;
}

ll find(ll i)
{
  while(parent[i] != -1)
  {
      i = parent[i];
  }
  return i;
}
void merge(ll a,ll b)
{
    a = find(a),b = find(b);
    if(a == b) return;
    else if(R[a] < R[b])
    {
        parent[a] = b;
        R[b] += R[a];
    }
    else
    {
        parent[b] = a;
        R[a] += R[b];
    }

}
bool checkPrime(ll n)
{
    if(n == 2) return true;
    if(n == 1) return false;
    bool flag = true;
    for(ll j = 2;(j * j) <= n;j++)
    {
     if((n % j) == 0)
     {
         flag = false;
         break;
     }
    }
    return flag;
}
void Compute(string s)
{
    KAKA
    pragi(1,s.length() + 1)
    {
        MakeSet(i);
    }
    map<char,ll> mp;
  pragi(1,s.length() + 1)
  {
      if(checkPrime(i))
      {
          for(ll j = 2;(i * j) <= s.length();j++)
          {
              merge(i,i * j);
          }
      }
      mp[s[i - 1]]++;
  }
  vector<pll> v;
  ll cnt = 0;
  pragi(1,s.length() + 1)
  {
      if(find(i) == i)
      {
          v.eb(MP(R[find(i)],find(i)));
          cnt++;
      }
  }
  //cout<<cnt<<"\n";
 sort all(v);
 reverse all(v);
 map<ll,char> htable;
 bool flag = true;
 for(auto ele : v)
 {
   ll sz = ele.F;
   ll cc = ele.S;
   char chosen;
   bool f = false;
   for(char ch = 'a';ch <= 'z';ch++)
   {
       if(mp[ch] >= sz)
       {
           chosen = ch;
           mp[ch] -= sz;
           f = true;
           break;
       }
   }
   if(f)
   {
       htable[cc] = chosen;
   }
   else
   {
       flag = false;
       break;
   }

 }
 if(!flag) cout<<"NO"<<"\n";
 else
 {
     cout<<"YES"<<"\n";
     pragi(1,s.length() + 1)
     {
         char ch = htable[find(i)];
         cout<<ch;
     }
     cout<<"\n";
 }

}
int main()
{
    KAKA
    string s;
    cin>>s;
    Compute(s);
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<int, int>

bool isPrime[1005];
bool vis[1005];
string s;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    for (int i = 2; i < 1005; i++) {
        if (vis[i]) continue;
        isPrime[i] = true;
        for (int j = i; j < 1005; j += i) {
            vis[j] = true;
        }
    }
    char mstc;
    int mst = 0;
    map<char, int> m;
    cin >> s;
    int S = s.size();

    int ct1 = 0;
    for (int i = 1; i <= S; i++) {
        if (i == 1) ct1++;
        if (isPrime[i] && 2 * i > S) ct1++;
    }

    for (auto c : s) m[c]++;
    for (auto p : m) {
        if (p.second > mst) {
            mst = p.second;
            mstc = p.first;
        }
    }
    if (mst < s.size() - ct1) {
        cout << "NO" << endl;
        return 0;
    }

    vector<char> v;
    for (int i = 0; i < mst - (s.size() - ct1); i++) v.push_back(mstc);
    for (auto p : m) {
        if (p.first != mstc) {
            for (int i = 0; i < p.second; i++) v.push_back(p.first);
        }
    }
    int idx = 0;
    cout << "YES" << endl;
    for (int i = 1; i <= s.size(); i++) {
        if (i == 1 || (isPrime[i] && 2 * i > S)) {
            cout << v[idx];
            idx++;
        } else {
            cout << mstc;
        }
    }
    cout << endl;

    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
#define fr(i,j,n)   for(int i=j;i<(n);++i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ordered_set tree<ll, null_type, less<ll> , rb_tree_tag, tree_order_statistics_node_update>

#define run ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef long long ll;

bool prime[1001];
vector<ll> pr;

void sieve()
{

    memset(prime, true, sizeof(prime));

    for (ll p=2; p*p<=1001; p++)
    {
        if (prime[p] == true)
        {
            pr.pb(p);
            for (ll i=p*p; i<=1001; i += p)
                prime[i] = false;
        }
    }

}

int main() {
	run;

	string s;
	cin>>s;
	sieve();
	ll n=s.length();
	ll a[26]={0};
	fr(i,0,n)
	{
	    a[s[i]-'a']++;
	}
	vector<pair<ll,ll> > v;
	fr(i,0,26)
	{
	    v.pb(mp(a[i],i));
	}
	sort(v.begin(),v.end());
	vector<ll> b;
	for(int i=pr.size()-1;i>=0;i--)
	{
	    if(pr[i]<=n && pr[i]*2>n)
	    {
	        b.pb(pr[i]);
	    }
	}
	ll k=n-b.size();
	if(v[25].F<k)
    {
        cout<<"NO";
        return 0;
    }

    string ans;
        v[25].F-=k;
        fr(i,0,n)
        {
            ans.pb((char)(v[25].S+'a'));
        }
        fr(i,0,b.size())
        {
            char c;
            fr(j,0,26)
            {
                if(v[j].F)
                {
                    c=v[j].S+'a';
                    v[j].F--;
                    break;
                }
            }
            ans[b[i]-1]=c;
        }

        cout<<"YES"<<endl;;
        cout<<ans;

	return 0;
}


#include <iostream>
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
#define fr(i,j,n)   for(int i=j;i<(n);++i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ordered_set tree<ll, null_type, less<ll> , rb_tree_tag, tree_order_statistics_node_update>

#define run ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef long long ll;

bool prime[1000001];
vector<ll> pr;

void sieve()
{

    memset(prime, true, sizeof(prime));

    for (ll p=2; p*p<=1000001; p++)
    {
        if (prime[p] == true)
        {
            pr.pb(p);
            for (ll i=p*p; i<=1000001; i += p)
                prime[i] = false;
        }
    }

}

int main() {
	run;

	string s;
	cin>>s;
	sieve();
	ll n=s.length();
	ll a[26]={0};
	fr(i,0,n)
	{
	    a[s[i]-'a']++;
	}
	vector<pair<ll,ll> > v;
	fr(i,0,26)
	{
	    v.pb(mp(a[i],i));
	}
	//cout<<n<<" ";
	sort(v.begin(),v.end());
	vector<ll> b;
	b.pb(1);
	for(int i=pr.size()-1;i>=0;i--)
	{
	    if(pr[i]<=n && pr[i]*2>n)
	    {
	        b.pb(pr[i]);
	      //  cout<<pr[i]<<" ";
	    }
	}
	ll k=n-b.size();
	if(v[25].F<k)
    {
        cout<<"NO";
        return 0;
    }

    string ans;
        v[25].F-=k;
        fr(i,0,n)
        {
            ans.pb((char)(v[25].S+'a'));
        }
        fr(i,0,b.size())
        {
            char c;
            fr(j,0,26)
            {
                if(v[j].F)
                {
                    c=v[j].S+'a';
                    v[j].F--;
                    break;
                }
            }
            ans[b[i]-1]=c;
        }

        cout<<"YES"<<endl;;
        cout<<ans;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define mod 1073741824
#define endl '\n'
bool checkprime(int n)
{
  for(int i=2;i*i<=n;i++)
  {
      if(n%i==0)
        return false;
  }
  return true;
}
signed main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);
   string str;
   cin>>str;
   int n=str.length();
   vector<int>prime;
   map<char,int>frequency;
   for(int i=0;i<n;i++)
    frequency[str[i]]++;
   int count=1;
   for(int i=(n/2)+1;i<=n;i++)
   {
       if(checkprime(i))
        ++count;
   }
   int temp=n-count;
   int ans=0;
   char t;
   for(char c='a';c<='z';c++)
   {
      if(frequency[c]>ans)
      {
        ans=frequency[c];
        t=c;
      }
   }
   if(ans<temp)
   {
      cout<<"NO";
      return 0;
   }
   ans-=temp;
   char a[n+1];
   for(int i=1;i<=n;i++)
    a[i]='0';
   for(int i=2;i<=n;i++)
   {
       if(checkprime(i)&&i>=(n/2)+1)
        continue;
       a[i]=t;
   }
   string fuck;
   for(int i=0;i<n;i++)
   {
       if(str[i]==t)
        continue;
       fuck+=str[i];
   }
   for(int i=0;i<ans;i++)
    fuck+=t;
  int j=0;
   cout<<"YES"<<endl;
   for(int i=1;i<=n;i++)
   {
      if(a[i]=='0')
      {
         cout<<fuck[j];
         j++;
      }
      else
        cout<<a[i];
   }
}


#include<bits/stdc++.h>
using namespace std;
#define mod 1073741824
#define endl '\n'
bool checkprime(int n)
{
  for(int i=2;i*i<=n;i++)
  {
      if(n%i==0)
        return false;
  }
  return true;
}
signed main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);
   string str;
   cin>>str;
   int n=str.length();
   vector<int>prime;
   map<char,int>frequency;
   for(int i=0;i<n;i++)
    frequency[str[i]]++;
   int count=1;
   for(int i=(n+3)/2;i<=n;i++)
   {
       if(checkprime(i))
        ++count;
   }
   int temp=n-count;
   int ans=0;
   char t;
   for(char c='a';c<='z';c++)
   {
      if(frequency[c]>ans)
      {
        ans=frequency[c];
        t=c;
      }
   }
   if(ans<temp)
   {
      cout<<"NO";
      return 0;
   }
   ans-=temp;
   char a[n+1];
   for(int i=1;i<=n;i++)
    a[i]='0';
   for(int i=2;i<=n;i++)
   {
       if(checkprime(i)&&i>=(n+3)/2)
        continue;
       a[i]=t;
   }
   string fuck;
   for(int i=0;i<n;i++)
   {
       if(str[i]==t)
        continue;
       fuck+=str[i];
   }
   for(int i=0;i<ans;i++)
    fuck+=t;
  int j=0;
   cout<<"YES"<<endl;
   for(int i=1;i<=n;i++)
   {
      if(a[i]=='0')
      {
         cout<<fuck[j];
         j++;
      }
      else
        cout<<a[i];
   }
}


#include<bits/stdc++.h>

using namespace std;

#define forn(i,a,b) for(long long i = a; i < b; i++)
#define pb push_back
#define ins insert
#define pr pair<int,int>
#define fr first
#define sc second
#define boost ios_base::sync_with_stdio(false); cin.tie(0);
typedef long long ll;

void print(vector<ll> v) {
    for(auto x : v) cout << x << " ";
    cout << endl;
}

const int mod = 1000000007;
const int inf = 1e9+5;

bool prime(int n) {
    if(n <= 1) return false;
    if(n == 2 || n == 3) return true;
    forn(i,2,sqrt(n)) if(n%i==0) return false;
    return true;
}

int main()
{
    string s;
    cin >> s;
    int n = s.size();
    int x2 = n/2;
    int freq[26];
    forn(i,0,26) freq[i] = 0;
    forn(i,0,n) {
        freq[s[i]-'a']++;
    }
    set<int> s1, s2;
    s1.ins(1);
    forn(i,2,n) {
        i++;
        if(prime(i)) {
            if(i*2 <= n) {
                s2.ins(i);
            }
            else s1.ins(i);
        }
        --i;
    }
    int freq2 = n/2 + s2.size();
    string t(n,'0');
    char c2 = '0';
    forn(i,0,26) {
        if(freq[i] >= freq2) {
            c2 = i+'a';
            freq[i] -= freq2;
            break;
        }
    }
    if(c2 == '0') {
        cout << "NO";
        return 0;
    }
    forn(i,0,n) {
        ++i;
        if(t[i-1] == '0') {
            int x = -1;
            if(i == 2) x = 2;
            else if(s2.find(i)!=s2.end()) {
                x = i;
            }
            if(x!=-1) for(int j = x; j <= n; j+=x) t[j-1] = c2;
            else {
                //cout << "in " << i << endl;
                for(int i1 = 0; i1 < 26; i1++) {
                    if(freq[i1]) {
                        freq[i1]--;
                  //      cout << "at i = " << i << " ins " << char(i1+'a') <<endl;
                        t[i-1] = i1+'a';
                        break;
                    }
                }
            }
        }
        --i;
    }
    cout << "YES\n";
    cout << t;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define forn(i,a,b) for(long long i = a; i < b; i++)
#define pb push_back
#define ins insert
#define pr pair<int,int>
#define fr first
#define sc second
#define boost ios_base::sync_with_stdio(false); cin.tie(0);
typedef long long ll;

void print(vector<ll> v) {
    for(auto x : v) cout << x << " ";
    cout << endl;
}

const int mod = 1000000007;
const int inf = 1e9+5;

bool prime(int n) {
    if(n <= 1) return false;
    if(n == 2 || n == 3) return true;
    forn(i,2,sqrt(n)) if(n%i==0) return false;
    return true;
}

int main()
{
    string s;
    cin >> s;
    int n = s.size();
    int x2 = n/2;
    int freq[26];
    forn(i,0,26) freq[i] = 0;
    forn(i,0,n) {
        freq[s[i]-'a']++;
    }
    int freq2 = n/2;
    set<int> s2;
    forn(i,2,n) {
        i++;
        if(prime(i)) {
            if(i*2 <= n) {
                s2.ins(i);
            }
        }
        --i;
    }
    int c = 0;
    for(int i = 0; i < 26; i++) {
        if(freq[c] < freq[i]) c = i;
    }
    char c2 = c+'a';
    //cout << c2 << " " << freq[c] << endl;
    string t(n,'0');
    forn(i,0,n) {
        ++i;
        if(t[i-1] == '0') {
            int x = -1;
            if(i == 2) x = 2;
            else if(s2.find(i)!=s2.end()) {
                x = i;
            }
            if(x!=-1) {
                    for(int j = x; j <= n; j+=x) {
                        if(t[j-1] == '0') {
                            if(freq[c2-'a']>0) {
                                t[j-1] = c2;
                                freq[c2-'a']--;
                            }
                            else {
                                cout << "NO";
                                return 0;
                            }
                        }
                    }
                }
            }
            //cout << i << " " << freq[c2-'a'] << " " << t << endl;
            --i;
        }
    forn(i,0,n) {
        if(t[i] == '0') {
            for(int i1 = 0; i1 < 26; i1++) {
                    if(freq[i1]) {
                        freq[i1]--;
                  //      cout << "at i = " << i << " ins " << char(i1+'a') <<endl;
                        t[i] = i1+'a';
                        break;
                    }
            }
        }
    }
    cout << "YES\n";
    cout << t;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

#define all(v) v.begin(), v.end()
#define sp(n) fixed << setprecision(n)
#define pb push_back
#define ff first
#define ss second

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

string s, ans;
map<char, int> cnt;

const int N = 1000;
int p[N + 1];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

#ifdef LOCAL_DEBUG
	freopen("input.txt", "r", stdin);
#endif

	for (int i = 2; i * i <= N; i++) {
		if (p[i]) continue;
		for (int j = i * i; j <= N; j += i)
			p[j] = 1;
	}

	cin >> s;
	for (char c : s) cnt[c]++;

	auto it = cnt.begin();
	for (auto i = cnt.begin(); i != cnt.end(); i++) {
		if (i->ss > it->ss) it = i;
	}

	for (int i = 0; i < s.size(); i++) {
		ans += '#';
		if (1 < i + 1 && i + 1 <= s.size() / 2 || p[i + 1]) {
			if (it->ss > 0) {
				ans[i] = it->ff;
				it->ss--;
			}
			else {
				cout << "NO\n";
				return 0;
			}
		}
	}

	it = cnt.begin();
	for (char& c : ans) {
		if (c != '#') continue;
		while (it != cnt.end() && it->ss == 0) it++;
		c = it->ff;
		it->ss--;
	}

	cout << "YES\n";
	cout << ans << endl;

	return 0;
}


#include <bits/stdc++.h>

#define ff first
#define ss second

using namespace std;
using ll = long long;
using pii = pair<int, int>;

const ll INF = LLONG_MAX;

ll dp[100001];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	string s;
	cin >> s;

	dp[0] = 1;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'w' || s[i] == 'm') break;
		dp[i + 1] = dp[i];
		if (i && s[i] == s[i - 1]) dp[i + 1] += dp[i - 1];
	}

	cout << dp[s.size()] << endl;

	return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <bitset>
#include <random>
#include <cassert>

using std::ios_base;
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using std::fixed;

using std::vector;
using std::string;
using std::stack;
using std::queue;
using std::deque;
using std::map;
using std::set;
using std::unordered_map;
using std::unordered_set;
using std::bitset;

using std::tuple;
using std::make_tuple;
using std::pair;
using std::make_pair;

using std::sort;
using std::reverse;
using std::nth_element;

#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define sqr(x) ((x) * (x))

#define forn(i, n) for (int i = 0; i < (int) (n); i++)
#define fornr(i, n) for (int i = (int) (n) - 1; i >= 0; i--)
#define forab(i, a, b) for (int i = (int) (a); i < (int) (b); i++)

struct __Timestamp {
    ~__Timestamp() {
        #ifdef LOCAL
        cerr << "\n== " << 1.0 * clock() / CLOCKS_PER_SEC << " sec.\n";
        #endif
    }
} __timestamp;

template<typename T>
void debug(T t) {
    #ifdef LOCAL
    cerr << t;
    #endif
}

template<typename T, typename... Args>
void debug(T t, Args... args) {
    #ifdef LOCAL
    debug(t);
    cerr << " ";
    debug(args...);
    #endif
}

const int N = 1005;

int n;
string s, t;
vector<int> g[N];
vector<int> pr;
int col[N], C = 0;
vector<int> cc[N];
vector<char> ca[N];

void dfs(int v) {
    col[v] = C;
    cc[C].pb(v);
    for (int u : g[v]) {
        if (!col[u]) {
            dfs(u);
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;

    cin >> s;
    n = s.size();

    for (int p = 2; p < N; ++p) {
        bool isp = true;
        for (int i = 2; i * i <= p; ++i) {
            if (p % i == 0)
                isp = false;
        }
        if (isp)
            pr.pb(p);
    }

    for (int p : pr) {
        for (int i = 1; i * p <= n; ++i) {
            g[p].pb(i * p);
            g[i * p].pb(p);
        }
    }

    forab(i, 1, n + 1) {
        if (!col[i]) {
            ++C;
            dfs(i);
        }
    }

    for (char c = 'a'; c <= 'z'; ++c) {
        int cnt = 0;
        for (char d : s) {
            cnt += c == d;
        }
        ca[cnt].pb(c);
    }

    t.resize(n);

    for (int c = 1; c <= C; ++c) {
        if (ca[cc[c].size()].empty()) {
            cout << "NO\n";
            exit(0);
        }
        char d = ca[cc[c].size()].back();
        ca[cc[c].size()].pop_back();
        for (int i : cc[c]) {
            t[i - 1] = d;
        }
    }

    cout << "YES\n";
    cout << t << '\n';

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <bitset>
#include <random>
#include <cassert>

using std::ios_base;
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using std::fixed;

using std::vector;
using std::string;
using std::stack;
using std::queue;
using std::deque;
using std::map;
using std::set;
using std::unordered_map;
using std::unordered_set;
using std::bitset;

using std::tuple;
using std::make_tuple;
using std::pair;
using std::make_pair;

using std::sort;
using std::reverse;
using std::nth_element;

#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define sqr(x) ((x) * (x))

#define forn(i, n) for (int i = 0; i < (int) (n); i++)
#define fornr(i, n) for (int i = (int) (n) - 1; i >= 0; i--)
#define forab(i, a, b) for (int i = (int) (a); i < (int) (b); i++)

struct __Timestamp {
    ~__Timestamp() {
        #ifdef LOCAL
        cerr << "\n== " << 1.0 * clock() / CLOCKS_PER_SEC << " sec.\n";
        #endif
    }
} __timestamp;

template<typename T>
void debug(T t) {
    #ifdef LOCAL
    cerr << t;
    #endif
}

template<typename T, typename... Args>
void debug(T t, Args... args) {
    #ifdef LOCAL
    debug(t);
    cerr << " ";
    debug(args...);
    #endif
}

const int N = 1005;

int n;
string s, t;
vector<pair<int, char>> ca;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;

    cin >> s;
    n = s.size();

    for (char c = 'a'; c <= 'z'; ++c) {
        int cnt = 0;
        for (char d : s) {
            cnt += c == d;
        }
        if (cnt)
            ca.emplace_back(cnt, c);
    }
    sort(ca.begin(), ca.end());

    t.resize(n);

    if (ca.back().first < n / 2) {
        cout << "NO\n";
        exit(0);
    }

    for (int i = 1; i < n; i += 2) {
        t[i] = ca.back().second;
        ca.back().first--;
    }

    for (int i = 0; i < n; i += 2) {
        while (ca.back().first == 0)
            ca.pop_back();
        t[i] = ca.back().second;
        ca.back().first--;
    }

    cout << "YES\n";
    cout << t << '\n';

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <bitset>
#include <random>
#include <cassert>

using std::ios_base;
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using std::fixed;

using std::vector;
using std::string;
using std::stack;
using std::queue;
using std::deque;
using std::map;
using std::set;
using std::unordered_map;
using std::unordered_set;
using std::bitset;

using std::tuple;
using std::make_tuple;
using std::pair;
using std::make_pair;

using std::sort;
using std::reverse;
using std::nth_element;

#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define sqr(x) ((x) * (x))

#define forn(i, n) for (int i = 0; i < (int) (n); i++)
#define fornr(i, n) for (int i = (int) (n) - 1; i >= 0; i--)
#define forab(i, a, b) for (int i = (int) (a); i < (int) (b); i++)

struct __Timestamp {
    ~__Timestamp() {
        #ifdef LOCAL
        cerr << "\n== " << 1.0 * clock() / CLOCKS_PER_SEC << " sec.\n";
        #endif
    }
} __timestamp;

template<typename T>
void debug(T t) {
    #ifdef LOCAL
    cerr << t;
    #endif
}

template<typename T, typename... Args>
void debug(T t, Args... args) {
    #ifdef LOCAL
    debug(t);
    cerr << " ";
    debug(args...);
    #endif
}

const int N = 1005;

int n;
string s, t;
bool isp[N];
vector<pair<int, char>> ca;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;

    cin >> s;
    n = s.size();

    memset(isp, 1, sizeof isp);
    isp[0] = isp[1] = 0;
    for (int i = 2; i < N; ++i) {
        if (isp[i]) {
            for (int j = i * i; j < N; j += i)
                isp[j] = 0;
        }
    }

    for (char c = 'a'; c <= 'z'; ++c) {
        int cnt = 0;
        for (char d : s) {
            cnt += c == d;
        }
        if (cnt)
            ca.emplace_back(cnt, c);
    }
    sort(ca.begin(), ca.end());

    t.resize(n);

    int cc = 0;
    for (int i = 1; i <= n; ++i) {
        if (i % 2 == 0 || (isp[i] && i * 2 <= n))
            ++cc;
    }

    if (ca.back().first < cc) {
        cout << "NO\n";
        exit(0);
    }

    for (int i = 1; i <= n; ++i) {
        if (i % 2 == 0 || (isp[i] && i * 2 <= n)) {
            t[i - 1] = ca.back().second;
            ca.back().first--;
        }
    }

    for (int i = 1; i <= n; ++i) {
        if (t[i - 1])
            continue;

        while (ca.back().first == 0)
            ca.pop_back();
        t[i - 1] = ca.back().second;
        ca.back().first--;
    }

    cout << "YES\n";
    cout << t << '\n';

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <bitset>
#include <random>
#include <cassert>

using std::ios_base;
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using std::fixed;

using std::vector;
using std::string;
using std::stack;
using std::queue;
using std::deque;
using std::map;
using std::set;
using std::unordered_map;
using std::unordered_set;
using std::bitset;

using std::tuple;
using std::make_tuple;
using std::pair;
using std::make_pair;

using std::sort;
using std::reverse;
using std::nth_element;

#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define sqr(x) ((x) * (x))

#define forn(i, n) for (int i = 0; i < (int) (n); i++)
#define fornr(i, n) for (int i = (int) (n) - 1; i >= 0; i--)
#define forab(i, a, b) for (int i = (int) (a); i < (int) (b); i++)

struct __Timestamp {
    ~__Timestamp() {
        #ifdef LOCAL
        cerr << "\n== " << 1.0 * clock() / CLOCKS_PER_SEC << " sec.\n";
        #endif
    }
} __timestamp;

template<typename T>
void debug(T t) {
    #ifdef LOCAL
    cerr << t;
    #endif
}

template<typename T, typename... Args>
void debug(T t, Args... args) {
    #ifdef LOCAL
    debug(t);
    cerr << " ";
    debug(args...);
    #endif
}

const int N = 1005;

int n;
string s, t;
bool isp[N];
vector<pair<int, char>> ca;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;

    cin >> s;
    n = s.size();

    memset(isp, 1, sizeof isp);
    isp[0] = isp[1] = 0;
    for (int i = 2; i < N; ++i) {
        if (isp[i]) {
            for (int j = i * i; j < N; j += i)
                isp[j] = 0;
        }
    }

    for (char c = 'a'; c <= 'z'; ++c) {
        int cnt = 0;
        for (char d : s) {
            cnt += c == d;
        }
        if (cnt)
            ca.emplace_back(cnt, c);
    }
    sort(ca.begin(), ca.end());

    int cc = n;
    for (int i = 1; i <= n; ++i) {
        if (i == 1 || (isp[i] && i * 2 > n))
            --cc;
    }

    if (ca.back().first < cc) {
        cout << "NO\n";
        exit(0);
    }

    t.resize(n);

    for (int i = 1; i <= n; ++i) {
        if (i == 1 || (isp[i] && i * 2 > n))
            continue;
        t[i - 1] = ca.back().second;
        ca.back().first--;
    }

    for (int i = 1; i <= n; ++i) {
        if (t[i - 1])
            continue;

        while (ca.back().first == 0)
            ca.pop_back();
        t[i - 1] = ca.back().second;
        ca.back().first--;
    }

    cout << "YES\n";
    cout << t << '\n';

    return 0;
}