[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
mpu = map from character to character
vec is vector of long longs of size 1000006
let b and a be empty integer arrays of size 1000006
let visit be empty boolean array of size 1000006
define the main function
    declare string variable s
    read s
    n and sum are long longs with sum = 0
    n = size of s
    declare vector of long longs called v
    for i = 2 to n inclusive
        set boolean t to 0
        for integer j = 2 to i exclusive
            if i % j = 0
                assign value of 1 to the t
                stop the loop
            end of the block
        end of the block
        if t = 0, push i into v
    end of the block
    w is an empty array of integers with size 26
    for i = 0 to length of s exclusive
        integer t = s[i] - 'a' casted to int
        increase w[t]
    end of the block
    for integer i = 0 to length of v exclusive
        if v[i] * 2 is greater than n, break
        for k = v[i] to length of s inclusive incrementing by v[i]
            if visit[k - 1] = 1, continue
            increment sum
            visit[k - 1] = 1
        end of the block
    end of the block
    if sum = 0
        print "YES\n", s and a new line
        return to indicate successful execution
    end of the block
    assign value -1 to the integer p
    for integer i = 0 to 26 exclusive
        if w[i] >= sum, set p to i
    end of the block
    if p = -1
        print "NO\n"
        return to indicate successful execution
    end of the block
    print "YES\n"
    for i = 0 to n exclusive
        if visit[i] = 1
            s[i] = char(p) + 'a'
            decrease w[p]
        end of the block
    end of the block
    for integer i = 0 to n exclusive
        if visit[i] = 1, continue
        for integer j = 0 to 26 exclusive
            if w[j] is greater than 0
                s[i] = char(j) + 'a'
                decrease w[j]
                stop the loop
            end of the block
        end of the block
    end of the block
    print s and a new line
end of the block

[CODE]:

map<char, char> mpu;
vector<long long> vec[1000006];
int b[1000006] = {}, a[1000006] = {};
bool visit[1000006] = {};
int main() {
    string s;
    cin >> s;
    long long n, sum = 0;
    n = s.size();
    vector<long long> v;
    for (int i = 2; i <= n; i++) {
        bool t = 0;
        for (int j = 2; j < i; j++) {
            if (i % j == 0) {
                t = 1;
                break;
            }
        }
        if (t == 0) { v.push_back(i); }
    }
    int w[26] = {};
    for (int i = 0; i < s.size(); i++) {
        int t = int(s[i] - 'a');
        w[t]++;
    }
    for (int i = 0; i < v.size(); i++) {
        if (v[i] * 2 > n) break;
        for (int k = v[i]; k <= s.size(); k += v[i]) {
            if (visit[k - 1] == 1) continue;
            sum++;
            visit[k - 1] = 1;
        }
    }
    if (sum == 0) {
        cout << "YES\n" << s << endl;
        return 0;
    }
    int p = -1;
    for (int i = 0; i < 26; i++) {
        if (w[i] >= sum) { p = i; }
    }
    if (p == -1) {
        cout << "NO\n";
        return 0;
    }
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
        if (visit[i] == 1) {
            s[i] = char(p) + 'a';
            w[p]--;
        }
    }
    for (int i = 0; i < n; i++) {
        if (visit[i] == 1) continue;
        for (int j = 0; j < 26; j++) {
            if (w[j] > 0) {
                s[i] = char(j) + 'a';
                w[j]--;
                break;
            }
        }
    }
    cout << s << endl;
}