#include <bits/stdc++.h>
using namespace std;
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...);
}
const long long int dx4[4] = {+1, -1, 0, 0};
const long long int dy4[4] = {0, 0, +1, -1};
const long long int dx8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
const long long int dy8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
const long long int MOD = 1e9 + 7;
const long long int INF = 1e10;
const long long int N = 2e5 + 5;
string s;
long long int n;
long long int parent[N];
long long int sz[N];
void make_set(long long int v) {
  parent[v] = v;
  sz[v] = 1;
}
long long int find_set(long long int v) {
  if (v == parent[v]) return v;
  return parent[v] = find_set(parent[v]);
}
void union_sets(long long int a, long long 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];
  }
}
vector<long long int> divisors(long long int n) {
  vector<long long int> ans;
  for (long long int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      if (i != 1) ans.push_back(i);
      if (n / i != i) ans.push_back(n / i);
    }
  }
  sort((ans).begin(), (ans).end());
  return ans;
}
void solve() {
  cin >> s;
  n = s.length();
  for (long long int i = 0; i <= n; i++) make_set(i);
  for (long long int i = 2; i <= n; i++) {
    vector<long long int> div = divisors(i);
    for (auto x : div) {
      union_sets(i, x);
    }
  }
  map<char, long long int> cnt;
  for (auto x : s) cnt[x]++;
  priority_queue<pair<long long int, char>> pq;
  for (auto x : cnt) {
    pq.push({x.second, x.first});
  }
  map<long long int, long long int> make_pair;
  priority_queue<pair<long long int, long long int>> needed;
  for (long long int i = 1; i <= n; i++) {
    if (make_pair.count(find_set(i))) continue;
    make_pair[find_set(i)] = sz[find_set(i)];
    needed.push({make_pair[find_set(i)], find_set(i)});
  }
  vector<char> res(n + 6, '?');
  while (pq.size()) {
    pair<long long int, char> x = pq.top();
    pq.pop();
    pair<long long int, long long int> xx = needed.top();
    needed.pop();
    if (x.first < xx.first) {
      cout << "NO\n";
      return;
    }
    res[xx.second] = x.second;
    x.first -= xx.first;
    if (x.first) {
      pq.push({x.first, x.second});
    }
  }
  for (long long int i = 1; i <= n; i++) {
    if (res[i] != '?') continue;
    long long int p = find_set(i);
    if (p == i) {
      pair<long long int, char> x = pq.top();
      pq.pop();
      res[i] = x.second;
      x.first -= 1;
      if (x.first) {
        pq.push({x.first, x.second});
      }
    } else {
      res[i] = res[p];
    }
  }
  cout << "YES\n";
  for (long long int i = 1; i <= n; i++) cout << res[i];
  return;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) solve();
  return 0;
}
