#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
typedef long long ll;

using namespace std;
char a[500010];
int ying[500010];
int sum[1000];
char yi[500010];
char er[500010];
int main()
{
    int n;
    cin >> n;
    cin >> a;
    memset(sum, 0, sizeof(sum));
    for(int i = 0; i < n; i++)
    {
        int num;
        if(a[i] >= 'a' && a[i] <= 'z')
        num = a[i]-'a';
        if(a[i] >= 'A' && a[i] <= 'Z')
        num = a[i]-'A'+26;
        if(a[i] >= '0' && a[i] <= '9')
        num = a[i]-'0'+26+26;
        sum[num]++;
    }
    int two = 0;
    int one = 0;
    for(int i = 0; i < 70; i++)
    {
        char ch;
            if(i >= 0 && i < 26)ch = 'a'+i;
            if(i >= 26 && i < 51)ch = 'A'+i-26;
            if(i >= 51 && i <= 61)ch = '0'+i-52;
        int kk = sum[i];
//        if(kk > 0)cout << kk << endl;
        while(kk > 1)
        {
            er[two++] = ch;
            kk -= 2;
        }
        if(kk == 1)yi[one++] = ch;
    }
//    cout << one << ' '<< two << endl;
    int ji = 0;
    for(int i = 1; i*i <= n; i++)
    {
        if(n%i == 0)
        {
            ying[ji++] = i;
            if(i != n/i)ying[ji++] = n/i;
        }
    }
    if(one == 0 && n%2 == 0)
    {
        cout << 1 << endl;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << ' '<< endl;
    }
    else if(one == 1 && n%2 == 1)
    {
        cout << 1 << endl;
        int two1 = two;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        cout << yi[0];
        two1 = two;
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << ' '<< endl;
    }
    else
    {
        for(int i = 0; i < ji; i++)
        {
            if(one == ying[i])
            {
                if((n/one)%2 == 1)
                {
                    cout << one << endl;
                    int one1 = one;
                    for(int h = 0; h < one1; h++)
                    {
                        stack<char> s;
                        while(!s.empty())s.pop();
                        for(int hh = 0; hh < n/one1/2; hh++)
                        {
                            cout << er[--two];
                            s.push(er[two]);
                        }
                        cout << yi[--one];
                        while(!s.empty())
                        {
                            cout << s.top();
                            s.pop();
                        }
                        cout << ' ';
                    }
                    cout << endl;
                    return 0;
                }

            }
        }

        cout << n << endl;
        for(int i = 0; i < n; i++)
        {
            cout << a[i] << ' ';
//            if(i == 0)cout << a[i];
//            else cout << ' ' << a[i];
        }
        cout << endl;
    }
//    if(n%2 == 0)
//    {
//        int sum1 = 0;
//        int nn = n;
//        while(nn%2 == 0)
//        {
//            sum1++;
//            nn /= 2;
//        }
//        if(one%2 == )
//    }
//    else
//    {
//        if(one <= 1)
////        {
//            char ok;
//            for(int i = 0; i < 70; i++)
//            {
//                char ch;
//                if(i >= 0 && i <= 26)ch = 'a';
//                if(i >= 27 && i <= 51)ch = 'A';
//                if(i >= 52 && i <= 61)ch = '1';
//                if(sum[i]%2 == 1)
//                {
//                    sum[i]--;
//                    ok = ch;
//                }
//                while(sum[i])
//                {
//                    cout << i+ch;
//                    sum[i] /= 2;
//                }
//            }
//            cout << ok << endl;
//        }
//        else
//        {
//            for(int i = 0; i < n; i++)
//            {
//                if(i == 0)cout << a[i];
//                else cout << ' ' << a[i];
//            }
//            cout << endl;
//        }
//    }
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
typedef long long ll;

using namespace std;
char a[400010];
int ying[400010];
int sum[100];
char yi[400010];
char er[400010];
int main()
{
    int n;
    cin >> n;
    cin >> a;
    memset(sum, 0, sizeof(sum));
    for(int i = 0; i < n; i++)
    {
        int num;
        if(a[i] >= 'a' && a[i] <= 'z')
        num = a[i]-'a';
        if(a[i] >= 'A' && a[i] <= 'Z')
        num = a[i]-'A'+26;
        if(a[i] >= '0' && a[i] <= '9')
        num = a[i]-'0'+26+26;
        sum[num]++;
    }
    int two = 0;
    int one = 0;
    for(int i = 0; i < 70; i++)
    {
        char ch;
            if(i >= 0 && i < 26)ch = 'a'+i;
            if(i >= 26 && i < 51)ch = 'A'+i-26;
            if(i >= 51 && i <= 61)ch = '0'+i-52;
        int kk = sum[i];
//        if(kk > 0)cout << kk << endl;
        while(kk > 1)
        {
            er[two++] = ch;
            kk -= 2;
        }
        if(kk == 1)yi[one++] = ch;
    }
//    cout << one << ' '<< two << endl;
    int ji = 0;
    for(int i = 1; i*i <= n; i++)
    {
        if(n%i == 0)
        {
            ying[ji++] = i;
            if(i != n/i)ying[ji++] = n/i;
        }
    }
    if(one == 0 && n%2 == 0)
    {
        cout << 1 << endl;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << endl;
    }
    else if(one == 1 && n%2 == 1)
    {
        cout << 1 << endl;
        int two1 = two;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        cout << yi[0];
        two1 = two;
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << endl;
    }
    else
    {
        for(int i = 0; i < ji; i++)
        {
            if(one == ying[i])
            {
                if((n/one)%2 == 1)
                {
                    cout << one << endl;
                    int one1 = one;
                    for(int h = 0; h < one1; h++)
                    {
                        stack<char> s;
                        while(!s.empty())s.pop();
                        for(int hh = 0; hh < n/one1/2; hh++)
                        {
                            cout << er[--two];
                            s.push(er[two]);
                        }
                        cout << yi[--one];
                        while(!s.empty())
                        {
                            cout << s.top();
                            s.pop();
                        }
                        cout << ' ';
                    }
                    cout << endl;
                    return 0;
                }

            }
        }

        cout << n << endl;
        for(int i = 0; i < n; i++)
        {
            cout << a[i] << ' ';
//            if(i == 0)cout << a[i];
//            else cout << ' ' << a[i];
        }
        cout << endl;
    }
//    if(n%2 == 0)
//    {
//        int sum1 = 0;
//        int nn = n;
//        while(nn%2 == 0)
//        {
//            sum1++;
//            nn /= 2;
//        }
//        if(one%2 == )
//    }
//    else
//    {
//        if(one <= 1)
////        {
//            char ok;
//            for(int i = 0; i < 70; i++)
//            {
//                char ch;
//                if(i >= 0 && i <= 26)ch = 'a';
//                if(i >= 27 && i <= 51)ch = 'A';
//                if(i >= 52 && i <= 61)ch = '1';
//                if(sum[i]%2 == 1)
//                {
//                    sum[i]--;
//                    ok = ch;
//                }
//                while(sum[i])
//                {
//                    cout << i+ch;
//                    sum[i] /= 2;
//                }
//            }
//            cout << ok << endl;
//        }
//        else
//        {
//            for(int i = 0; i < n; i++)
//            {
//                if(i == 0)cout << a[i];
//                else cout << ' ' << a[i];
//            }
//            cout << endl;
//        }
//    }
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
typedef long long ll;

using namespace std;
char a[500010];
int ying[500010];
int sum[1000];
char yi[500010];
char er[500010];
set<char> s;
int main()
{
    int n;
    cin >> n;
    scanf("%s", a);
    memset(sum, 0, sizeof(sum));
    int one = 0;
    int two = 0;
    for(int i = 0; i < n; i++)
    {
        if(s.count(a[i]) == 0)
        {
            s.insert(a[i]);
        }
        else
        {
            er[two++] = a[i];
            s.erase(a[i]);
        }
    }
    for(set<char>::iterator it = s.begin(); it != s.end(); it++)
    {
        yi[one++] = *it;
    }
    if(one == 0)
    {
        cout << 1 << endl;
        for(int i = 0; i < two; i++)
        cout << er[i];
        for(int i = two-1; i >= 0; i--)
        cout << er[i];
        cout << endl;
    }
    else
    {
        int mm = n/one;
        while(mm%2 != 1 || n/mm*mm != n)
        {
            yi[one++] = er[--two];
            yi[one++] = er[two];
            mm = n/one;
        }
        if(mm%2 == 1 && n/mm*mm == n)
        {
            cout << one << endl;
            int one1 = one;
            for(int i = 0; i < one1; i++)
            {
                stack<char> ss;
                for(int i = 0; i < n/one1/2; i++)
                {
                    cout << er[--two];
                    ss.push(er[two]);
                }
                cout << yi[--one];
                while(!ss.empty())
                {
                    cout << ss.top();
                    ss.pop();
                }
                cout << ' ';
            }
            cout << endl;
        }
        else
        {
            cout << n << endl;
            for(int i = 0; i < n; i++)
            cout << a[i] << ' ';
            cout << endl;
        }
    }
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
typedef long long ll;

using namespace std;
char a[400010];
int ying[400010];
int sum[100];
char yi[400010];
char er[400010];
int main()
{
    int n;
    cin >> n;
    cin >> a;
    memset(sum, 0, sizeof(sum));
    for(int i = 0; i < n; i++)
    {
        int num;
        if(a[i] >= 'a' && a[i] <= 'z')
        num = a[i]-'a';
        if(a[i] >= 'A' && a[i] <= 'Z')
        num = a[i]-'A'+26;
        if(a[i] >= '0' && a[i] <= '9')
        num = a[i]-'0'+26+26;
        sum[num]++;
    }
    int two = 0;
    int one = 0;
    for(int i = 0; i < 70; i++)
    {
        char ch;
            if(i >= 0 && i < 26)ch = 'a'+i;
            if(i >= 26 && i < 51)ch = 'A'+i-26;
            if(i >= 51 && i <= 61)ch = '0'+i-52;
        int kk = sum[i];
//        if(kk > 0)cout << kk << endl;
        while(kk > 1)
        {
            er[two++] = ch;
            kk -= 2;
        }
        if(kk == 1)yi[one++] = ch;
    }
//    cout << one << ' '<< two << endl;
    int ji = 0;
    for(int i = 1; i*i <= n; i++)
    {
        if(n%i == 0)
        {
            ying[ji++] = i;
            if(i != n/i)ying[ji++] = n/i;
        }
    }
    if(one == 0 && n%2 == 0)
    {
        cout << 1 << endl;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << ' '<< endl;
    }
    else if(one == 1 && n%2 == 1)
    {
        cout << 1 << endl;
        int two1 = two;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        cout << yi[0];
        two1 = two;
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << ' '<< endl;
    }
    else
    {
        for(int i = 0; i < ji; i++)
        {
            if(one == ying[i])
            {
                if((n/one)%2 == 1)
                {
                    cout << one << endl;
                    int one1 = one;
                    for(int h = 0; h < one1; h++)
                    {
                        stack<char> s;
                        while(!s.empty())s.pop();
                        for(int hh = 0; hh < n/one1/2; hh++)
                        {
                            cout << er[--two];
                            s.push(er[two]);
                        }
                        cout << yi[--one];
                        while(!s.empty())
                        {
                            cout << s.top();
                            s.pop();
                        }
                        cout << ' ';
                    }
                    cout << endl;
                    return 0;
                }

            }
        }

        cout << n << endl;
        for(int i = 0; i < n; i++)
        {
            cout << a[i] << ' ';
//            if(i == 0)cout << a[i];
//            else cout << ' ' << a[i];
        }
        cout << endl;
    }
//    if(n%2 == 0)
//    {
//        int sum1 = 0;
//        int nn = n;
//        while(nn%2 == 0)
//        {
//            sum1++;
//            nn /= 2;
//        }
//        if(one%2 == )
//    }
//    else
//    {
//        if(one <= 1)
////        {
//            char ok;
//            for(int i = 0; i < 70; i++)
//            {
//                char ch;
//                if(i >= 0 && i <= 26)ch = 'a';
//                if(i >= 27 && i <= 51)ch = 'A';
//                if(i >= 52 && i <= 61)ch = '1';
//                if(sum[i]%2 == 1)
//                {
//                    sum[i]--;
//                    ok = ch;
//                }
//                while(sum[i])
//                {
//                    cout << i+ch;
//                    sum[i] /= 2;
//                }
//            }
//            cout << ok << endl;
//        }
//        else
//        {
//            for(int i = 0; i < n; i++)
//            {
//                if(i == 0)cout << a[i];
//                else cout << ' ' << a[i];
//            }
//            cout << endl;
//        }
//    }
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
typedef long long ll;

using namespace std;
char a[400010];
int ying[400010];
int sum[100];
char yi[400010];
char er[400010];
int main()
{
    int n;
    cin >> n;
    cin >> a;
    memset(sum, 0, sizeof(sum));
    for(int i = 0; i < n; i++)
    {
        int num;
        if(a[i] >= 'a' && a[i] <= 'z')
        num = a[i]-'a';
        if(a[i] >= 'A' && a[i] <= 'Z')
        num = a[i]-'A'+26;
        if(a[i] >= '0' && a[i] <= '9')
        num = a[i]-'0'+26+26;
        sum[num]++;
    }
    int two = 0;
    int one = 0;
    for(int i = 0; i < 70; i++)
    {
        char ch;
            if(i >= 0 && i < 26)ch = 'a'+i;
            if(i >= 26 && i < 51)ch = 'A'+i-26;
            if(i >= 51 && i <= 61)ch = '0'+i-52;
        int kk = sum[i];
//        if(kk > 0)cout << kk << endl;
        while(kk > 1)
        {
            er[two++] = ch;
            kk -= 2;
        }
        if(kk == 1)yi[one++] = ch;
    }
//    cout << one << ' '<< two << endl;
    int ji = 0;
    for(int i = 1; i*i <= n; i++)
    {
        if(n%i == 0)
        {
            ying[ji++] = i;
            if(i != n/i)ying[ji++] = n/i;
        }
    }
    if(one == 0 && n%2 == 0)
    {
        int two1 = two;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        two1 = two;
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << endl;
    }
    else if(one == 0 && n%2 == 1)
    {
        int two1 = two;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        cout << yi[0];
        two1 = two;
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << endl;
    }
    else
    {
        for(int i = 0; i < ji; i++)
        {
            if(one == ying[i])
            {
                if((n/one)%2 == 1)
                {
                    int one1 = one;
                    for(int h = 0; h < one1; h++)
                    {
                        stack<char> s;
                        if(h != 0)cout << ' ';
                        for(int hh = 0; hh < n/one1/2; hh++)
                        {
                            cout << er[--two];
                            s.push(er[two]);
                        }
                        cout << yi[--one];
                        while(!s.empty())
                        {
                            cout << s.top();
                            s.pop();
                        }
                    }
                    cout << endl;
                    return 0;
                }

            }
        }

        for(int i = 0; i < n; i++)
        {
            if(i == 0)cout << a[i];
            else cout << ' ' << a[i];
        }
        cout << endl;
    }
//    if(n%2 == 0)
//    {
//        int sum1 = 0;
//        int nn = n;
//        while(nn%2 == 0)
//        {
//            sum1++;
//            nn /= 2;
//        }
//        if(one%2 == )
//    }
//    else
//    {
//        if(one <= 1)
////        {
//            char ok;
//            for(int i = 0; i < 70; i++)
//            {
//                char ch;
//                if(i >= 0 && i <= 26)ch = 'a';
//                if(i >= 27 && i <= 51)ch = 'A';
//                if(i >= 52 && i <= 61)ch = '1';
//                if(sum[i]%2 == 1)
//                {
//                    sum[i]--;
//                    ok = ch;
//                }
//                while(sum[i])
//                {
//                    cout << i+ch;
//                    sum[i] /= 2;
//                }
//            }
//            cout << ok << endl;
//        }
//        else
//        {
//            for(int i = 0; i < n; i++)
//            {
//                if(i == 0)cout << a[i];
//                else cout << ' ' << a[i];
//            }
//            cout << endl;
//        }
//    }
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
typedef long long ll;

using namespace std;
char a[500010];
int ying[500010];
int sum[1000];
char yi[500010];
char er[500010];
int main()
{
    int n;
    cin >> n;
    scanf("%s", a);
    memset(sum, 0, sizeof(sum));
    for(int i = 0; i < n; i++)
    {
        int num;
        if(a[i] >= 'a' && a[i] <= 'z')
        num = a[i]-'a';
        if(a[i] >= 'A' && a[i] <= 'Z')
        num = a[i]-'A'+26;
        if(a[i] >= '0' && a[i] <= '9')
        num = a[i]-'0'+26+26;
        sum[num]++;
    }
    int two = 0;
    int one = 0;
    for(int i = 0; i < 70; i++)
    {
        char ch;
            if(i >= 0 && i < 26)ch = 'a'+i;
            if(i >= 26 && i < 51)ch = 'A'+i-26;
            if(i >= 51 && i <= 61)ch = '0'+i-52;
        int kk = sum[i];
//        if(kk > 0)cout << kk << endl;
        while(kk > 1)
        {
            er[two++] = ch;
            kk -= 2;
        }
        if(kk == 1)yi[one++] = ch;
    }
//    cout << one << ' '<< two << endl;
    int ji = 0;
    for(int i = 1; i*i <= n; i++)
    {
        if(n%i == 0)
        {
            ying[ji++] = i;
            if(i != n/i)ying[ji++] = n/i;
        }
    }
    if(one == 0 && n%2 == 0)
    {
        cout << 1 << endl;
        for(int i = 0; i < two; i++)
        {
            cout << er[i];
        }
        for(int i = two-1; i >= 0; i--)
        {
            cout << er[i];
        }
        cout << ' '<< endl;
    }
    else
    {
        int mm = n/one;
        while(mm%2 != 1 || n/mm*mm != n)
        {
            yi[one++] = er[--two];
            yi[one++] = er[two];
            mm = n/one;
        }
        if(mm%2 == 1 && n/mm*mm == n)
        {
            cout << one << endl;
            int one1 = one;
            for(int h = 0; h < one1; h++)
            {
                stack<char> s;
                while(!s.empty())s.pop();
                for(int hh = 0; hh < n/one1/2; hh++)
                {
                    cout << er[--two];
                    s.push(er[two]);
                }
                cout << yi[--one];
                while(!s.empty())
                {
                    cout << s.top();
                    s.pop();
                }
                cout << ' ';
            }
            cout << endl;
            return 0;
        }

        cout << n << endl;
        for(int i = 0; i < n; i++)
        {
            cout << a[i] << ' ';
//            if(i == 0)cout << a[i];
//            else cout << ' ' << a[i];
        }
        cout << endl;
    }
    return 0;
}


import java.util.*;
import java.io.*;
import java.math.*;
public class Main3
{
    static class Reader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String s(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;}
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public double d() throws IOException {return Double.parseDouble(s()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public int[] arr(int n){int[] ret = new int[n];for (int i = 0; i < n; i++) {ret[i] = i();}return ret;}
    }

           //       |----|       /\      |    |   -----   |
           //       |   /       /  \     |    |     |     |
           //       |--/       /----\    |----|     |     |
           //       |   \     /      \   |    |     |     |
           //       |    \   /        \  |    |   -----   -------
    static class pair
    {
       int x;
       int y;
       public pair (int k, int p)
       {
           x = k;
           y = p;
       }
       @Override
       public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            pair pair = (pair) o;
            return x == pair.x && y == pair.y;
        }

       @Override
       public int hashCode() {
            return Objects.hash(x, y);
       }
    }
    static class PriorityComparator implements Comparator<pair>
    {
        public int compare(pair first, pair second)
        {
            return second.x-first.x;
        }
    }
    static PriorityComparator pc = new PriorityComparator();
    static PriorityQueue<pair> pq = new PriorityQueue<pair>(pc);
    static int n;
    public static void main(String[] args)throws IOException
    {
        PrintWriter out= new PrintWriter(System.out);
        Reader sc=new Reader();
        n=sc.i();
        int arr[]=sc.arr(n);
        int brr[]=sc.arr(n);
        ArrayList<Integer> al=new ArrayList<>();
        for(int i=0;i<n;i++)
        {
            if(arr[i]==0&&brr[i]==0)
            {
                al.add(i);
            }
        }
        if(al.size()==0||arr[0]!=0||brr[n-1]!=0)
        {
            System.out.println("NO");
            System.exit(0);
        }
        int ans[]=new int[n];
        for(int i=0;i<n;i++)
        pq.add(new pair(arr[i]+brr[i],i));
        pair p=pq.remove();
        ans[p.y]=1;
        int curr=1;
        int prevsum=p.x;
        while(pq.size()!=0)
        {
            p=pq.remove();
            if(p.x==prevsum)
            ans[p.y]=curr;
            else
            {
                ans[p.y]=++curr;
                prevsum=p.x;
            }
        }
        for(int i=0;i<n;i++)
        {
            int c1=0;int c2=0;
            for(int j=0;j<i;j++)
            if(ans[j]>ans[i])c1++;
            for(int j=i+1;j<n;j++)
            if(ans[j]>ans[i])c2++;
            if(c1!=arr[i]||c2!=brr[i])
            {
                System.out.println("NO");
                System.exit(0);
            }
        }
        System.out.println("YES");
        for(int i=0;i<n;i++)
        out.print(ans[i]+" ");
        out.flush();
    }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class java2 {
    public static void main(String[] args) {
        Scanner r = new Scanner(System.in);
        int n=r.nextInt();
        int []l=new int[1005];
        int []ri=new int[1005];
        int []candy=new int[1005];
        for(int i=1;i<=n;++i)
        {
            l[i]=r.nextInt();
        }
        for(int i=1;i<=n;++i)
        {
            ri[i]=r.nextInt();
        }
        for(int i=1;i<=n;++i)
        {
            if(l[i]>i-1||ri[i]>n-i)
            {
                System.out.println("NO");
                System.exit(0);
            }
            candy[i]=n-l[i]-ri[i];
        }
        for(int i=1;i<=n;++i)
        {
            int left=0,right=0;
            for(int j=1;j<=i-1;++j)
            {
                if(candy[j]>candy[i])
                {
                    ++left;
                }
            }
            for(int j=i+1;j<=n;++j)
            {
                if(candy[j]>candy[i])
                {
                    ++right;
                }
            }
            if(left!=l[i]||right!=ri[i])
            {
                System.out.println("NO");
                System.exit(0);
            }
        }
        System.out.println("YES");
        for(int i=1;i<=n;++i)
        {
            System.out.print(candy[i]+" ");
        }
    }
}


import java.util.*;
public class CF{
    public static void main(String arg[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l[] = new int[n];
        int r[] = new int[n];
        for(int i=0;i<n;i++) l[i] = sc.nextInt();
        for(int i=0;i<n;i++) r[i] = sc.nextInt();
        int ans[] = new int[n];
        if(fun(ans, l, r, n)==-1) System.out.println("NO");
        else{
            System.out.println("YES");
            for(int i: ans) System.out.print(i + " ");
        }
    }
    static int fun(int ans[], int l[], int r[], int n){
        for(int i=0;i<n;i++){
            if(l[i] > i) return -1;
            if(r[i] > (n-i-1)) return -1;
        }
        for(int i=0;i<n;i++){
            ans[i] = n - l[i] - r[i] - 1;
        }
        int nl[] = new int[n];
        int nr[] = new int[n];
        for(int i=0;i<n;i++){
            for(int j=i-1;j>=0;j--){
                if(ans[j] > ans[i]) nl[i]++;
            }
            for(int j=i+1;j<n;j++){
                if(ans[j] > ans[i]) nr[i]++;
            }
        }
        for(int i=0;i<n;i++){
            if(l[i]!=nl[i] || r[i]!=nr[i]) return -1;
        }
        return 1;
    }
}


import java.util.*;
public class CF{
    public static void main(String arg[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l[] = new int[n];
        int r[] = new int[n];
        for(int i=0;i<n;i++) l[i] = sc.nextInt();
        for(int i=0;i<n;i++) r[i] = sc.nextInt();
        int ans[] = new int[n];
        if(fun(ans, l, r, n)==-1) System.out.println("NO");
        else{
            System.out.println("YES");
            for(int i: ans) System.out.print(i + " ");
        }
    }
    static int fun(int ans[], int l[], int r[], int n){
        for(int i=0;i<n;i++){
            if(l[i] > i) return -1;
            if(r[i] > (n-i-1)) return -1;
        }
        for(int i=0;i<n;i++){
            ans[i] = n - l[i] - r[i];
        }
        int nl[] = new int[n];
        int nr[] = new int[n];
        for(int i=0;i<n;i++){
            for(int j=i-1;j>=0;j--){
                if(ans[j] > ans[i]) nl[i]++;
            }
            for(int j=i+1;j<n;j++){
                if(ans[j] > ans[i]) nr[i]++;
            }
        }
        for(int i=0;i<n;i++){
            if(l[i]!=nl[i] || r[i]!=nr[i]) return -1;
        }
        return 1;
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author noob_coder
 */
public class Main {
        public static void main(String[] args) {
                InputStream inputStream = System.in;
                OutputStream outputStream = System.out;
                InputReader in = new InputReader(inputStream);
                PrintWriter out = new PrintWriter(outputStream);
                TaskC solver = new TaskC();
                solver.solve(1, in, out);
                out.close();
        }

        static class TaskC {
                public void solve(int testNumber, InputReader in, PrintWriter out) {
                        int n = in.i();
                        int[] left = in.ia(n);
                        int[] right = in.ia(n);

                        int[] ans = new int[n];
                        for (int i = 0; i < n; i++) {
                                ans[i] = n - left[i] - right[i];
                        }
                        if (checkleft(left, ans, n) && checkright(right, ans, n)) {
                                out.println("YES");
                                Arrays.stream(ans).forEach(e -> out.print(e + " "));
                        } else {
                                out.println("NO");
                        }
                }

                private boolean checkright(int[] right, int[] ans, int n) {
                        for (int i = n - 2; i >= 0; i--) {
                                int count = 0;
                                for (int j = i + 1; j < n; j++) {
                                        if (ans[j] > ans[i]) count++;
                                }
                                if (count != right[i]) return false;
                        }
                        return true;
                }

                private boolean checkleft(int[] left, int[] ans, int n) {
                        for (int i = 1; i < n; i++) {
                                int count = 0;
                                for (int j = i - 1; j >= 0; j--) {
                                        if (ans[j] > ans[i]) count++;
                                }
                                if (count != left[i]) return false;
                        }
                        return true;
                }

        }

        static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

                public InputReader(InputStream is) {
                        this.is = is;
                }

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int[] ia(int n) {
                        int[] a = new int[n];
                        for (int i = 0; i < n; i++) a[i] = i();
                        return a;
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author noob_coder
 */
public class Main {
        public static void main(String[] args) {
                InputStream inputStream = System.in;
                OutputStream outputStream = System.out;
                InputReader in = new InputReader(inputStream);
                PrintWriter out = new PrintWriter(outputStream);
                TaskC solver = new TaskC();
                solver.solve(1, in, out);
                out.close();
        }

        static class TaskC {
                public void solve(int testNumber, InputReader in, PrintWriter out) {
                        int n = in.i();
                        int[] left = in.ia(n);
                        int[] right = in.ia(n);

                        int[] ans = new int[n];
                        for (int i = 0; i < n; i++) {
                                ans[i] = n - left[i] - right[i];
                        }
                        if (checkleft(left, ans, n) && checkright(right, ans, n) || n == 1) {
                                out.println("YES");
                                Arrays.stream(ans).forEach(e -> out.print(e + " "));
                        } else {
                                out.println("NO");
                        }
                }

                private boolean checkright(int[] right, int[] ans, int n) {
                        for (int i = n - 2; i >= 0; i--) {
                                int count = 0;
                                for (int j = i + 1; j < n; j++) {
                                        if (ans[j] > ans[i]) count++;
                                }
                                if (count != right[i]) return false;
                        }
                        return true;
                }

                private boolean checkleft(int[] left, int[] ans, int n) {
                        for (int i = 1; i < n; i++) {
                                int count = 0;
                                for (int j = i - 1; j >= 0; j--) {
                                        if (ans[j] > ans[i]) count++;
                                }
                                if (count != left[i]) return false;
                        }
                        return true;
                }

        }

        static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

                public InputReader(InputStream is) {
                        this.is = is;
                }

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int[] ia(int n) {
                        int[] a = new int[n];
                        for (int i = 0; i < n; i++) a[i] = i();
                        return a;
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author noob_coder
 */
public class Main {
        public static void main(String[] args) {
                InputStream inputStream = System.in;
                OutputStream outputStream = System.out;
                InputReader in = new InputReader(inputStream);
                PrintWriter out = new PrintWriter(outputStream);
                TaskC solver = new TaskC();
                solver.solve(1, in, out);
                out.close();
        }

        static class TaskC {
                public void solve(int testNumber, InputReader in, PrintWriter out) {
                        int n = in.i();
                        int[] left = in.ia(n);
                        int[] right = in.ia(n);
                        if (left[0] != 0 || right[n - 1] != 0) {
                                out.println("NO");
                                return;
                        }
                        int[] ans = new int[n];
                        for (int i = 0; i < n; i++) {
                                ans[i] = n - left[i] - right[i];
                        }
                        if (checkleft(left, ans, n) && checkright(right, ans, n)) {
                                out.println("YES");
                                Arrays.stream(ans).forEach(e -> out.print(e + " "));
                        } else {
                                out.println("NO");
                        }
                }

                private boolean checkright(int[] right, int[] ans, int n) {
                        for (int i = n - 2; i >= 0; i--) {
                                int count = 0;
                                for (int j = i + 1; j < n; j++) {
                                        if (ans[j] > ans[i]) count++;
                                }
                                if (count != right[i]) return false;
                        }
                        return true;
                }

                private boolean checkleft(int[] left, int[] ans, int n) {
                        for (int i = 1; i < n; i++) {
                                int count = 0;
                                for (int j = i - 1; j >= 0; j--) {
                                        if (ans[j] > ans[i]) count++;
                                }
                                if (count != left[i]) return false;
                        }
                        return true;
                }

        }

        static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

                public InputReader(InputStream is) {
                        this.is = is;
                }

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int[] ia(int n) {
                        int[] a = new int[n];
                        for (int i = 0; i < n; i++) a[i] = i();
                        return a;
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.IntStream;

public class Main {
    InputStream is;
    BufferedReader bufferedReader;
    PrintWriter out;
    String INPUT = "";

    int row[] = { -1, 0, 1, 0 };
    int column[] = { 0, 1, 0, -1 };

    void solve() {

      int n = ni();
      int left[] = new int[1004];
      int right[] = new int[1004];
      boolean flag = false;
        for (int i = 0; i < n; ++i) {
            left[i] = ni();
            //right[i] = ni();
        }
        for (int i = 0; i < n; ++i) {
            right[i] = ni();
            //right[i] = ni();
        }
      for (int i = 0; i < n; ++i) {

          if (left[i] > i) {
              out.println("NO");
              flag = true;
              break;
          }
          if (right[i] > n - i - 1) {
              out.println("NO");
              flag = true;
              break;
          }

      }

      int ans[] = new int[1005];
      IntStream.range(0, n)
                .forEach(i -> ans[i] = 1);

      if (!flag) {

          int min_sum = left[0] + right[0];
          int last = -1;
          for (int i = n; i >=1; --i) {
              for (int j = 0; j< n; ++j) {
                  if (left[j] + right[j] <= min_sum && left[j] + right[j] > last) {
                      min_sum =  left[j] + right[j];
                  }
              }

              for (int j = 0; j < n; ++j) {
                  if (left[j] + right[j] == min_sum) {
                      ans[j] = i;
                  }
              }
              last = min_sum;
                min_sum+=1;
          }

          for (int i =0; i < n; ++i) {
              int count = 0;
              for (int j = i+1; j < n; ++j) {
                  if (ans[i] < ans[j]) {
                      count++;
                  }
              }
              if (count != right[i]){
                  out.println("NO");
                  return;
              }
          }

          for (int i =0; i < n; ++i) {
              int count = 0;
              for (int j = 0; j < i; ++j) {
                  if (ans[i] < ans[j]) {
                      count++;
                  }
              }
              if (count != left[i]){
                  out.println("NO");
                  return;
              }
          }

          out.println("YES");
          for (int i =0; i < n; ++i) {
              out.print(ans[i] + " ");
          }
      }

    }

    private int solve (char[][]matrix, int x, int y, int ml, int mr, int sx, int sy, int n, int m, boolean[][] visit) {
        if (x < 0 || y < 0 || x >= n || y >= m || visit[x][y]) {
            visit[x][y] = true;
            return 0;
        }

        visit[x][y] = true;

        if (matrix[x][y] == '*') {
            return 0;
        }
        if (y <= sy && sy - y <= ml) {
            return  1 +  solve(matrix, x+1, y, ml, mr, sx, sy, n, m, visit) + solve(matrix, x, y+1, ml, mr, sx, sy, n, m, visit)
                    + solve(matrix, x-1, y, ml, mr, sx, sy, n, m, visit) +solve(matrix, x, y-1, ml, mr, sx, sy, n, m, visit);

        }
        else if (y >= sy && y - sy <= mr) {
            return  1 + solve(matrix, x+1, y, ml, mr, sx, sy, n, m, visit) + solve(matrix, x, y+1, ml, mr, sx, sy, n, m, visit)
                    + solve(matrix, x-1, y, ml, mr, sx, sy, n, m, visit) +solve(matrix, x, y-1, ml, mr, sx, sy, n, m, visit);

        }
        return 0;
    }

    private BigInteger modulo(BigInteger a, BigInteger b, BigInteger c) {
        BigInteger t1 = a.mod(c);
        BigInteger t2 = b.mod(c);
        BigInteger t3 = t1.multiply(t2);
        return t3.mod(c);

//        BigInteger x= BigInteger.valueOf(1);
//        BigInteger y=a;
//        while(b.compareTo(BigInteger.valueOf(0)) > 0){
//            if(b.mod(BigInteger.valueOf(2)).equals( BigInteger.valueOf(1))){
//                x= x.multiply(y).mod(c);
//            }
//            y = y.multiply(y).mod(c); // squaring the base
//            b = b.divide(BigInteger.valueOf(2));
//        }
//        return x.mod(c);
    }

    private boolean sameBlock(String f, String t, int j) {
        return f.charAt(j) == '#' && t.charAt(j) == '#' || f.charAt(j) == '#' && t.charAt(j - 1) == '#' || f.charAt(j - 1) == '#' && t.charAt(j) == '#';
    }

    void run() throws Exception {
        is =  System.in;

        //is = new BufferedInputStream(new FileInputStream("./input.txt"));

        out = new PrintWriter(System.out);

        //out = new PrintWriter(new BufferedWriter(new FileWriter("./output.txt")));

        long s = System.currentTimeMillis();
        solve();
        //inputThird();
        out.close();
        //tr(System.currentTimeMillis()-s+"ms");
    }

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
    private boolean isNewLineChar(int c) { return c == 10;}

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private String nsTillNewLine() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isNewLineChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private String nsF() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while((isSpaceChar(b)) && b!=' '){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        long b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//Help: https://www.geeksforgeeks.org/connected-components-in-an-undirected-graph/
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.*;
public class Main
{

    public static void main(String[] args)throws IOException
    {
        FastReader in=new FastReader(System.in);
        StringBuffer st1=new StringBuffer();
        Queue<Integer> q1= new LinkedList<>();
        Queue<Integer> q2= new LinkedList<>();
        int nr,nod,act,t=0;
        int sol[]=new int[5003];
        int viz[]=new int[5003];
        int s1[]=new int[5003];
        int d1[]=new int[5003];
        int st[]=new int[5003];
        int dr[]=new int[5003];
         int n=in.nextInt();
         for(int i=1;i<=n;++i){
          st[i]=in.nextInt();
          s1[i]=st[i];
          }
         for(int i=1;i<=n;++i){
          dr[i]=in.nextInt();
          d1[i]=dr[i];
          }
        for(int i=1;i<=n;++i){
           if(st[i]+dr[i]==0){
            viz[i]=1;
            q1.add(i);
            q2.add(n);
            }
          }
        if(q1.size()==0){
          System.out.println("NO");
          System.exit(0);
          }
       nr=n;
       while(q1.size()!=0){
        nod=q1.remove();
        t=q2.remove();
        sol[nod]=t;
        for(int i=1;i<nod;++i)
        {
            --dr[i];
            if(viz[i]>=0&&st[i]+dr[i]==0)
            {
                viz[i]=1;
                q1.add(i);
                q2.add(t-1);
            }
        }
        for(int i=nod+1;i<=n;++i)
        {
            --st[i];
            if(viz[i]>=0&&st[i]+dr[i]==0)
            {
                viz[i]=1;
                q1.add(i);
                q2.add(t-1);
            }
        }
    }
    for(int i=1;i<=n;++i)
    {
        if(sol[i]<1||sol[i]>n)
        {
          System.out.println("NO");
          System.exit(0);
        }
    }
    for(int i=1;i<=n;++i)
    {
        act=0;
        for(int j=1;j<i;++j) if(sol[j]>sol[i])
         ++act;
        if(act!=s1[i])
        {
          System.out.println("NO");
          System.exit(0);
        }
        act=0;
        for(int j=i+1;j<=n;++j) if(sol[j]>sol[i])
         ++act;
        if(act!=d1[i])
        {
          System.out.println("NO");
          System.exit(0);
          }
      }
      System.out.println("YES");
      for(int i=1;i<=n;++i){
      if(i!=n)
       st1.append(sol[i]+" ");
      else if(i==n)
        st1.append(sol[i]);
      }

        System.out.print(st1);
    }
    static class FastReader{

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan());
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan());
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }

        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan());
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
}


import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
	 static class Reader
	    {
	        final private int BUFFER_SIZE = 1 << 16;
	        private DataInputStream din;
	        private byte[] buffer;
	        private int bufferPointer, bytesRead;

	        public Reader()
	        {
	            din = new DataInputStream(System.in);
	            buffer = new byte[BUFFER_SIZE];
	            bufferPointer = bytesRead = 0;
	        }

	        public Reader(String file_name) throws IOException
	        {
	            din = new DataInputStream(new FileInputStream(file_name));
	            buffer = new byte[BUFFER_SIZE];
	            bufferPointer = bytesRead = 0;
	        }

	        public String readLine() throws IOException
	        {
	            byte[] buf = new byte[64]; // line length
	            int cnt = 0, c;
	            while ((c = read()) != -1)
	            {
	                if (c == '\n')
	                    break;
	                buf[cnt++] = (byte) c;
	            }
	            return new String(buf, 0, cnt);
	        }

	        public int nextInt() throws IOException
	        {
	            int ret = 0;
	            byte c = read();
	            while (c <= ' ')
	                c = read();
	            boolean neg = (c == '-');
	            if (neg)
	                c = read();
	            do
	            {
	                ret = ret * 10 + c - '0';
	            }  while ((c = read()) >= '0' && c <= '9');

	            if (neg)
	                return -ret;
	            return ret;
	        }

	        public long nextLong() throws IOException
	        {
	            long ret = 0;
	            byte c = read();
	            while (c <= ' ')
	                c = read();
	            boolean neg = (c == '-');
	            if (neg)
	                c = read();
	            do {
	                ret = ret * 10 + c - '0';
	            }
	            while ((c = read()) >= '0' && c <= '9');
	            if (neg)
	                return -ret;
	            return ret;
	        }

	        public double nextDouble() throws IOException
	        {
	            double ret = 0, div = 1;
	            byte c = read();
	            while (c <= ' ')
	                c = read();
	            boolean neg = (c == '-');
	            if (neg)
	                c = read();

	            do {
	                ret = ret * 10 + c - '0';
	            }
	            while ((c = read()) >= '0' && c <= '9');

	            if (c == '.')
	            {
	                while ((c = read()) >= '0' && c <= '9')
	                {
	                    ret += (c - '0') / (div *= 10);
	                }
	            }

	            if (neg)
	                return -ret;
	            return ret;
	        }

	        private void fillBuffer() throws IOException
	        {
	            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
	            if (bytesRead == -1)
	                buffer[0] = -1;
	        }

	        private byte read() throws IOException
	        {
	            if (bufferPointer == bytesRead)
	                fillBuffer();
	            return buffer[bufferPointer++];
	        }

	        public void close() throws IOException
	        {
	            if (din == null)
	                return;
	            din.close();
	        }
	    }
	static final int MAX=1000000007;
	static int power(int x, int y, int p)
    {
        // Initialize result
        int res = 1;

        // Update x if it is more
        // than or equal to p
        x = x % p;

        while (y > 0)
        {
            // If y is odd, multiply x
            // with result
            if((y & 1)==1)
                res = (res * x) % p;

            // y must be even now
            // y = y / 2
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }

    public static void main(String[] args) throws IOException{
		Reader s=new Reader();
		int n=s.nextInt();
		int[] a=new int[n];
		int[] b=new int[n];
		int[] ans=new int[n];
		for(int i=0;i<n;i++) {
			a[i]=s.nextInt();
		}
		for(int i=0;i<n;i++) {
			b[i]=s.nextInt();
		}
		for(int i=0;i<n;i++) {
			ans[i]=n-b[i]-a[i];
		}
		for(int i=0;i<n;i++) {
			int cnt=0;
			for(int j=(i+1);j<n;j++) {
				if(ans[i]<ans[j]) {
					cnt++;
				}
			}
			if(b[i]!=cnt) {
				System.out.println("NO");
				return;
			}
		}
		for(int i=n-1;i>=0;i--) {
			int cnt=0;
			for(int j=(i-1);j>=0;j--) {
				if(ans[j]>ans[i]) {
					cnt++;
				}
			}
			if(a[i]!=cnt) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
		for(int i=0;i<n;i++) {
			System.out.print(ans[i]+" ");
		}
	}
}


import java.lang.*;
import java.math.*;
import java.rmi.activation.ActivationGroup_Stub;
import java.util.*;
import java.io.*;

public class Main {
class Node implements Comparable<Node>{
    int id;
    int l;
    int r;
    public Node(int id,int l,int r){
        this.id=id;
        this.l=l;
        this.r=r;
    }
    public int compareTo(Node c){
        int t=Integer.compare(this.l+this.r,c.l+c.r);
        return t;
    }
}
    void solve(){
        int n=ni();
        int l[]=new int[n+1];
        int r[]=new int[n+1];
        int a[]=new int[n+1];
        for(int i=1;i<=n;i++) l[i]=i-1-ni();
        for(int i=1;i<=n;i++) r[i]=n-i-ni();
        for(int i=1;i<=n;i++){
            if(l[i]<0 || r[i]<0){
                pw.println("NO");
                return;
            }
        }
        Node p[]=new Node[n+1];
        for(int i=1;i<=n;i++) p[i]=new Node(i,l[i],r[i]);
        Arrays.sort(p,1,n+1);
        int prev=1;
        a[p[1].id]=1;
        for(int i=2;i<=n;i++){
            if(p[i-1].l+p[i-1].r==p[i].l+p[i].r){
                a[p[i].id]=prev;
            }else {
                prev++;
                if(prev>n){
                    pw.println("NO");
                    return;
                }
                a[p[i].id]=prev;

            }
        }
        for(int i=1;i<=n;i++){
            int c1=0,c2=0;
            for(int j=1;j<i;j++) if(a[j]<=a[i]) c1++;
            for(int j=i+1;j<=n;j++) if(a[j]<=a[i]) c2++;
            if(c1!=l[i] || c2!=r[i]){
                pw.println("NO");
                return;
            }
        }

        pw.println("YES");
        for(int i=1;i<=n;i++) pw.print(a[i]+" ");

    }
    long M= (long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";
    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
    }
    public static void main(String[] args) throws Exception { new Main().run(); }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(INPUT.length() > 0)System.out.println(Arrays.deepToString(o)); }

}


//package Codef;

import java.util.Scanner;

public class C_1054 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int[] l = new int[n];
		int[] r = new int[n];
		int[] lr = new int[n];
		for (int i = 0; i < n; i++) {
			l[i] = s.nextInt();
		}
		int c = 0;
		for (int i = 0; i < n; i++) {
			r[i] = s.nextInt();
			lr[i] = n - l[i] - r[i];
		}
		for (int i = 0; i < n; i++) {
			int ll = 0;
			for (int j = 0; j < i; j++) {
				if (lr[j] > lr[i]) {
					ll++;
				}
			}
			int rr = 0;
			for (int j = i + 1; j < n; j++) {
				if (lr[j] > lr[i]) {
					rr++;
				}
			}
			if (ll != l[i] || rr != r[i]) {
				System.out.println("NO");
				return;
			}

		}
		//if (c == 0) {
			System.out.println("YES");
			for (int i = 0; i < n; i++) {
				System.out.print(lr[i] + " ");
			}
		//}
	}

}


import java.io.*;
import java.util.*;

public class Main_1054C {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		int[] l = sc.nextIntArray(n);
		int[] r = sc.nextIntArray(n);

		Set<Integer> ts = new TreeSet<>();
		for (int i = 0; i < n; i++) {
			ts.add(l[i] + r[i]);
		}

		List<Integer> s = new ArrayList<>(ts);
		Collections.sort(s);
		if (s.get(0) != 0) {
			pr.println("NO");
			return;
		}

		int[] ans = new int[n];
		for (int i = 0; i < n; i++) {
			int sum = l[i] + r[i];

			ans[i] = n - Collections.binarySearch(s, sum);
		}

		int[] ll = new int[n];
		int[] rr = new int[n];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (ans[j] > ans[i]) {
					ll[i]++;
				}
			}
			for (int j = i + 1; j < n; j++) {
				if (ans[j] > ans[i]) {
					rr[i]++;
				}
			}
		}

		for (int i = 0; i < n; i++) {
			if (l[i] != ll[i] || r[i] != rr[i]) {
				pr.println("NO");
				return;
			}
		}

		pr.println("YES");
		pr.printInts(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	static class Scanner {
		BufferedReader br;

		Scanner (InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}

		private boolean isPrintable(int ch) {
			return ch >= '!' && ch <= '~';
		}

		private boolean isCRLF(int ch) {
			return ch == '\n' || ch == '\r' || ch == -1;
		}

		private int nextPrintable() {
			try {
				int ch;
				while (!isPrintable(ch = br.read())) {
					if (ch == -1) {
						throw new NoSuchElementException();
					}
				}

				return ch;
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		String next() {
			try {
				int ch = nextPrintable();
				StringBuilder sb = new StringBuilder();
				do {
					sb.appendCodePoint(ch);
				} while (isPrintable(ch = br.read()));

				return sb.toString();
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		int nextInt() {
			try {
				// parseInt from Integer.parseInt()
				boolean negative = false;
				int res = 0;
				int limit = -Integer.MAX_VALUE;
				int radix = 10;

				int fc = nextPrintable();
				if (fc < '0') {
					if (fc == '-') {
						negative = true;
						limit = Integer.MIN_VALUE;
					} else if (fc != '+') {
						throw new NumberFormatException();
					}
					fc = br.read();
				}
				int multmin = limit / radix;

				int ch = fc;
				do {
					int digit = ch - '0';
					if (digit < 0 || digit >= radix) {
						throw new NumberFormatException();
					}
					if (res < multmin) {
						throw new NumberFormatException();
					}
					res *= radix;
					if (res < limit + digit) {
						throw new NumberFormatException();
					}
					res -= digit;

				} while (isPrintable(ch = br.read()));

				return negative ? res : -res;
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		long nextLong() {
			try {
				// parseLong from Long.parseLong()
				boolean negative = false;
				long res = 0;
				long limit = -Long.MAX_VALUE;
				int radix = 10;

				int fc = nextPrintable();
				if (fc < '0') {
					if (fc == '-') {
						negative = true;
						limit = Long.MIN_VALUE;
					} else if (fc != '+') {
						throw new NumberFormatException();
					}
					fc = br.read();
				}
				long multmin = limit / radix;

				int ch = fc;
				do {
					int digit = ch - '0';
					if (digit < 0 || digit >= radix) {
						throw new NumberFormatException();
					}
					if (res < multmin) {
						throw new NumberFormatException();
					}
					res *= radix;
					if (res < limit + digit) {
						throw new NumberFormatException();
					}
					res -= digit;

				} while (isPrintable(ch = br.read()));

				return negative ? res : -res;
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		float nextFloat() {
			return Float.parseFloat(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			try {
				int ch;
				while (isCRLF(ch = br.read())) {
					if (ch == -1) {
						throw new NoSuchElementException();
					}
				}
				StringBuilder sb = new StringBuilder();
				do {
					sb.appendCodePoint(ch);
				} while (!isCRLF(ch = br.read()));

				return sb.toString();
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = sc.nextInt();
			}

			return ret;
		}

		long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = sc.nextLong();
			}

			return ret;
		}

		int[][] nextIntArrays(int n, int m) {
			int[][] ret = new int[m][n];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					ret[j][i] = sc.nextInt();
				}
			}

			return ret;
		}

		void close() {
			try {
				br.close();
			} catch (IOException e) {
//				throw new NoSuchElementException();
			}
		}
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}

		void printInts(int... a) {
			StringBuilder sb = new StringBuilder(32);
			for (int i = 0, size = a.length; i < size; i++) {
				if (i > 0) {
					sb.append(' ');
				}
				sb.append(a[i]);
			}

			println(sb);
		}

		void printLongs(long... a) {
			StringBuilder sb = new StringBuilder(64);
			for (int i = 0, size = a.length; i < size; i++) {
				if (i > 0) {
					sb.append(' ');
				}
				sb.append(a[i]);
			}

			println(sb);
		}

		void printStrings(String... a) {
			StringBuilder sb = new StringBuilder(32);
			for (int i = 0, size = a.length; i < size; i++) {
				if (i > 0) {
					sb.append(' ');
				}
				sb.append(a[i]);
			}

			println(sb);
		}
	}
}


//package Practice3.CF1054;

import java.util.*;

public class CF1054C {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] l = new int[n];
        int[] r = new int[n];
        for (int i = 0; i < n; i++) {
            l[i] = s.nextInt();
        }

        for (int i = 0; i < n; i++) {
            r[i] = s.nextInt();
        }

        Queue<Integer> ans = new LinkedList<>();
        int j = 0;
        while(j != n){
            ArrayList<Integer> indices = new ArrayList<>();
            HashSet<Integer> index = new HashSet<>();
            int k = j;
            for (int i = 0; i < n; i++) {
                if(l[i] == 0 && r[i] == 0){
                    indices.add(i);
                    index.add(i);
                    j++;
                }
            }
            if(k == j){
                System.out.println("NO");
                return;
            }

            int added = 0;
            int subtracted = indices.size();
            for (int i = 0; i < n; i++) {
                if(index.contains(i)){
                    subtracted--;
                    added++;
                }else{
                    l[i] -= added;
                    r[i] -= subtracted;
                }
            }

            for (int i = 0; i < indices.size(); i++) {
                l[indices.get(i)] = Integer.MAX_VALUE;
                r[indices.get(i)] = Integer.MAX_VALUE;
            }

            ans.addAll(indices);
            ans.add(null);
        }
        int num = 1;
        int[] arr = new int[n];
        while(!ans.isEmpty()){
            Integer k = ans.poll();
            if(k == null){
                num++;
                continue;
            }
            arr[k] = num;
        }

        for (int i = 0; i < n; i++) {
            arr[i] = num - arr[i] ;
        }
        System.out.println("YES");
        for (int i = 0; i < n; i++) {
            System.out.print(arr[i] + " ");
        }
//        System.out.println(Arrays.toString(arr));
//        System.out.println(ans);
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,j,k;
	cin>>n;
	int l[n],r[n];
	for(i=0;i<n;i++)
		cin>>l[i];
	for(i=0;i<n;i++)
		cin>>r[i];
	int rank[n];
	int f=0;
	vector< pair<int,int> > v(n);
	for(i=0;i<n;i++)
	{
		rank[i]=l[i]+r[i];
		if(rank[i]>n-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]==0)
			f=1;
		v[i]={rank[i],i};
	}
	if(f==0)
	{

		cout<<"NO";
		return 0;
	}
	else
	{
		sort(v.begin(),v.end());
		reverse(v.begin(),v.end());
		int sc[n]={0};
		sc[0]++;
		for(i=n-2;i>=0;i--)
		{
			sc[v[i].first]++;
		}
		int so_far=0;
		for(i=0;i<n;i++)
		{
			if(sc[i])
			{
				if(i!=so_far)
				{
					cout<<"NO";
					return 0;
				}
				so_far+=sc[i];
			}
		}
		int mx=n;
		int can[n];
		i=n-1;
		while(i>=0)
		{
			pair<int,int> p=v[i];
			int ind=p.second;
			can[ind]=mx;
			j=i-1;
			while(v[j].first==v[i].first && j>=0)
			{
				can[v[j].second]=mx;
				j--;
			}
			mx--;
			i=j;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)
			cout<<can[i]<<" ";
	}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,j,k;
	cin>>n;
	int l[n],r[n];
	for(i=0;i<n;i++)
		cin>>l[i];
	for(i=0;i<n;i++)
		cin>>r[i];
	int rank[n];
	bool f=0;
	vector< pair<int,int> > v(n);
	for(i=0;i<n;i++)
	{
		rank[i]=l[i]+r[i];
		if(rank[i]>n-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]==0)
			f=1;
		v[i]={rank[i],i};
	}
	if(f==0)
	{

		cout<<"NO";
		return 0;
	}
	else
	{
		sort(v.begin(),v.end());
		reverse(v.begin(),v.end());
		int mx=n;
		int can[n];
		i=n-1;
		while(i>=0)
		{
			pair<int,int> p=v[i];
			int ind=p.second;
			can[ind]=mx;
			j=i-1;
			while(v[j].first==v[i].first && j>=0)
			{
				can[v[j].second]=mx;
				j--;
			}
			mx--;
			i=j;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)
			cout<<can[i]<<" ";
	}
}


#include <bits/stdc++.h>
using namespace std;
int sc[1000];
int main()
{
	int n,i,j,k;
	cin>>n;
	int l[n],r[n];
	for(i=0;i<n;i++)
		cin>>l[i];
	for(i=0;i<n;i++)
		cin>>r[i];
	int rank[n];
	int f=0;
	vector< pair<int,int> > v(n);
	for(i=0;i<n;i++)
	{
		rank[i]=l[i]+r[i];
		if(rank[i]>n-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]==0)
			f=1;
		v[i]={rank[i],i};
	}
	if(f==0)
	{

		cout<<"NO";
		return 0;
	}
	else
	{
		if(n==1)
		{
			cout<<"YES\n";
			cout<<1;
			return 0;
		}
		sort(v.begin(),v.end());
		reverse(v.begin(),v.end());
		sc[0]++;
		for(i=n-2;i>=0;i--)
		{
			sc[v[i].first]++;
		}
		int so_far=0;
		for(i=0;i<n;i++)
		{
			if(sc[i])
			{
				if(i!=so_far)
				{
					cout<<"NO";
					return 0;
				}
				so_far+=sc[i];
			}
		}
		int mx=n;
		int can[n];
		i=n-1;
		while(i>=0)
		{
			pair<int,int> p=v[i];
			int ind=p.second;
			can[ind]=mx;
			j=i-1;
			while(v[j].first==v[i].first && j>=0)
			{
				can[v[j].second]=mx;
				j--;
			}
			mx--;
			i=j;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)
			cout<<can[i]<<" ";
	}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,j,k;
	cin>>n;
	int l[n],r[n];
	for(i=0;i<n;i++)
		cin>>l[i];
	for(i=0;i<n;i++)
		cin>>r[i];
	int rank[n];
	bool f=0;
	vector< pair<int,int> > v(n);
	for(i=0;i<n;i++)
	{
		rank[i]=l[i]+r[i];
		if(rank[i]>n-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]==0)
			f=1;
		v[i]={rank[i],i};
	}
	if(f==0)
	{

		cout<<"NO";
		return 0;
	}
	else
	{
	//	cout<<"v";
		sort(v.begin(),v.end());
		reverse(v.begin(),v.end());
		int mx=n;
		int can[n];
		i=n-1;
		while(i>=0)
		{
			pair<int,int> p=v[i];
			int ind=p.second;
			can[ind]=mx;
			j=i-1;
			while(v[j].first==v[i].first && j>=0)
			{
				can[v[j].second]=mx;
				j--;
			}
			mx--;
			i=j;
		}
		for(i=0;i<n;i++)
			cout<<can[i]<<" ";
	}
}


#include <bits/stdc++.h>
using namespace std;
int sc[1000];
int main()
{
	int n,i,j,k;
	cin>>n;
	int l[n],r[n];
	for(i=0;i<n;i++)
		cin>>l[i];
	for(i=0;i<n;i++)
		cin>>r[i];
	int rank[n];
	int f=0;
	vector< pair<int,int> > v(n);
	for(i=0;i<n;i++)
	{
		rank[i]=l[i]+r[i];
		if(l[i]>i|| r[i]>n-i-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]>n-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]==0)
			f=1;
		v[i]={rank[i],i};
	}
	if(f==0)
	{
		cout<<"NO";
		return 0;
	}
	else
	{
		if(n==1)
		{
			cout<<"YES\n";
			cout<<1;
			return 0;
		}
		sort(v.begin(),v.end(),greater< pair<int,int> >());
		sc[0]++;
		for(i=n-2;i>=0;i--)
		{
			sc[v[i].first]++;
		}
		int so_far=0;
		for(i=0;i<n;i++)
		{
			if(sc[i])
			{
				if(i!=so_far)
				{
					cout<<"NO";
					return 0;
				}
				so_far+=sc[i];
			}
		}
		int mx=n;
		int can[n];
		i=n-1;
		while(i>=0)
		{
			pair<int,int> p=v[i];
			int ind=p.second;
			can[ind]=mx;
			j=i-1;
			while(v[j].first==v[i].first && j>=0)
			{
				can[v[j].second]=mx;
				j--;
			}
			mx--;
			i=j;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)
			cout<<can[i]<<" ";
	}
}


#include <bits/stdc++.h>
using namespace std;
int sc[1000];
int main()
{
	int n,i,j,k;
	cin>>n;
	int l[n],r[n];
	for(i=0;i<n;i++)
		cin>>l[i];
	for(i=0;i<n;i++)
		cin>>r[i];
	int rank[n];
	int f=0;
	vector< pair<int,int> > v(n);
	for(i=0;i<n;i++)
	{
		rank[i]=l[i]+r[i];
		if(rank[i]>n-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]==0)
			f=1;
		v[i]={rank[i],i};
	}
	if(f==0)
	{

		cout<<"NO";
		return 0;
	}
	else
	{
		if(n==1)
		{
			cout<<"YES\n";
			cout<<1;
			return 0;
		}
		sort(v.begin(),v.end(),greater< pair<int,int> >());
		sc[0]++;
		for(i=n-2;i>=0;i--)
		{
			sc[v[i].first]++;
		}
		int so_far=0;
		for(i=0;i<n;i++)
		{
			if(sc[i])
			{
				if(i!=so_far)
				{
					cout<<"NO";
					return 0;
				}
				so_far+=sc[i];
			}
		}
		int mx=n;
		int can[n];
		i=n-1;
		while(i>=0)
		{
			pair<int,int> p=v[i];
			int ind=p.second;
			can[ind]=mx;
			j=i-1;
			while(v[j].first==v[i].first && j>=0)
			{
				can[v[j].second]=mx;
				j--;
			}
			mx--;
			i=j;
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)
			cout<<can[i]<<" ";
	}
}


#include <bits/stdc++.h>
using namespace std;
int sc[1000];
int main()
{
	int n,i,j,k;
	cin>>n;
	int l[n],r[n];
	for(i=0;i<n;i++)
		cin>>l[i];
	for(i=0;i<n;i++)
		cin>>r[i];
	int rank[n];
	int f=0;
	vector< pair<int,int> > v(n);
	for(i=0;i<n;i++)
	{
		rank[i]=l[i]+r[i];
		if(l[i]>i|| r[i]>n-i-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]>n-1)
		{
			cout<<"NO";
			return 0;
		}
		if(rank[i]==0)
			f=1;
		v[i]={rank[i],i};
	}
	if(f==0)
	{
		cout<<"NO";
		return 0;
	}
	else
	{
		if(n==1)
		{
			cout<<"YES\n";
			cout<<1;
			return 0;
		}
		sort(v.begin(),v.end(),greater< pair<int,int> >());
		sc[0]++;
		for(i=n-2;i>=0;i--)
		{
			sc[v[i].first]++;
		}
		int so_far=0;
		for(i=0;i<n;i++)
		{
			if(sc[i])
			{
				if(i!=so_far)
				{
					cout<<"NO";
					return 0;
				}
				so_far+=sc[i];
			}
		}
		int mx=n;
		int can[n];
		i=n-1;
		while(i>=0)
		{
			pair<int,int> p=v[i];
			int ind=p.second;
			can[ind]=mx;
			j=i-1;
			while(v[j].first==v[i].first && j>=0)
			{
				can[v[j].second]=mx;
				j--;
			}
			mx--;
			i=j;
		}
		int la[n],ra[n];
		for(i=0;i<n;i++)
		{
			ra[i]=0;
			la[i]=0;
			for(j=i+1;j<n;j++)
			{
				if(can[j]>can[i])
					ra[i]++;
			}
			for(j=i-1;j>=0;j--)
			{
				if(can[j]>can[i])
					la[i]++;
			}
			if(la[i]!=l[i]||ra[i]!=r[i])
			{
				cout<<"NO";
				return 0;
			}
		}
		cout<<"YES\n";
		for(i=0;i<n;i++)
			cout<<can[i]<<" ";
	}
}


/**
 *    Author:  "Robin Singh" !!!
 *    BrainyIsTheNewSexy     (CodeForces)
 *    rob_in_1               (Other OJs)
**/
#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define IO  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ff first
#define ss second
#define mp make_pair
#define szz(v) ((int)(v).size())
#define fr(i, j, k) for(int i = j; i < k; i++)
#define bk(i, j, k) for(int i = j-1; i >= k; i--)
#define mem(ptr)  memset(ptr, 0, sizeof ptr)
#define sbit(n)  __builtin_popcount(n)
#define nl "\n"
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector <int> vi;
typedef vector <long long> vll;
typedef vector < pair<int,int> > vpii;
typedef vector < pair<ll, ll> > vpll;

//---------------------------------------------*DEBUGGING*--------------------------------------------------------->]
#define dbg( args...) { vector<string> _v = split( #args, ','); err( _v.begin(), args); cerr << '\n'; }
vector<string> split( const string& s, char c) { vector<string> v; stringstream ss( s); string x;
while ( getline( ss, x, c)) v.emplace_back(x); return move(v); }
void err( vector<string>::iterator it) { }
template<typename T, typename... Args>
void err( vector<string>::iterator it, T a, Args... args) {
    cerr << it -> substr( ( *it)[0] == ' ', it -> length()) << " = " << a << '\t'; err( ++it, args...); }
//----------------------------------------------------------------------------------------------------------------->]
//*****************************************!Template Ends Here!*****************************************************]

const long long mod = 1e9+7;
const long double eps = 1e-9;
const long long INF = (1LL<<61);
const int inf = (1<<30);
const int nn = 1e6+5;

void NO(){
    cout << "NO";
    exit(0);
}

void update(){

}
int main()
{
    // IO;
    IOS;
    int n;
    cin >> n;
    int l[n], r[n];
    fr(i, 0, n) cin >> l[i];
    fr(i, 0, n) cin >> r[i];

    vi par[n+1];

    int ans[n];
    fill(ans, ans+n, 1);

    for(int i=0; i<n; i++){
        if(l[i] > i) NO();
        if(! l[i]) continue;
        int c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) {
                c++;
                par[i].pb(j);
            }
        }

        if(c > l[i]) NO();
        if(c == l[i]) continue;

        for(int j=i-1; j>=0; j--){
            if(ans[j] <= ans[i]){
                par[i].pb(j);
                ans[j] = 1 + max(ans[j], ans[i]);
                c++;
                queue <int> q;
                q.push(j);
                while(! q.empty()){
                    int y = q.front();
                    q.pop();
                    for(int x : par[y]){
                        ans[x] = max(ans[x], ans[y]) + 1;
                        if(szz(par[x])) q.push(x);
                    }
                }
                if(c == l[i]) break;
            }
        }
    }

    // fr(i, 0, n) dbg(ans[i]);
    // fr(i, 0, n) par[i].clear();
    vi par2[nn];

    for(int i = n-1; i >=0; i--){
        if(r[i] > n-1-i) NO();
        if(! r[i]) continue;
        int c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) {
                c++;
                par2[i].pb(j);
            }
        }

        if(c > r[i]) NO();
        if(c == r[i]) continue;

        for(int j=i-1; j>=0; j--){
            if(ans[j] <= ans[i]){
                par2[i].pb(j);
                ans[j] = 1 + max(ans[j], ans[i]);
                c++;
                queue <int> q;
                q.push(j);
                while(! q.empty()){
                    int y = q.front();
                    q.pop();
                    for(int x : par[y]){
                        ans[x] = max(ans[x], ans[y]) + 1;
                        if(szz(par2[x])) q.push(x);
                    }
                }
                if(c == r[i]) break;
            }
        }
    }

    fr(i, 0, n){
        int c = 0;
        fr(j, i+1, n){
            if(ans[j] > ans[i]) c++;
        }
        if(c != r[i]) NO();
        c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) c++;
        }
        if(c != l[i]) NO();
    }

    cout << "YES\n";
    fr(i, 0, n) cout << ans[i] << ' ';
    return 0;
}


/**
 *    Author:  "Robin Singh" !!!
 *    BrainyIsTheNewSexy     (CodeForces)
 *    rob_in_1               (Other OJs)
**/

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define IO  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ff first
#define ss second
#define MP make_pair
#define szz(v) ((int)(v).size())
#define fr(i, j, k) for(int i = j; i < k; i++)
#define bk(i, j, k) for(int i = j-1; i >= k; i--)
#define mem(ptr)  memset(ptr, 0, sizeof ptr)
#define sbit(n)  __builtin_popcount(n)
#define nl "\n"
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector <int> vi;
typedef vector <long long> vll;
typedef vector < pair<int,int> > vpii;
typedef vector < pair<ll, ll> > vpll;

//---------------------------------------------*DEBUGGING*--------------------------------------------------------->]
#define dbg( args...) { vector<string> _v = split( #args, ','); err( _v.begin(), args); cerr << '\n'; }
vector<string> split( const string& s, char c) { vector<string> v; stringstream ss( s); string x;
while ( getline( ss, x, c)) v.emplace_back(x); return move(v); }
void err( vector<string>::iterator it) { }
template<typename T, typename... Args>
void err( vector<string>::iterator it, T a, Args... args) {
    cerr << it -> substr( ( *it)[0] == ' ', it -> length()) << " = " << a << '\t'; err( ++it, args...); }
//----------------------------------------------------------------------------------------------------------------->]
//*****************************************!Template Ends Here!*****************************************************]

pii dir[8] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1}, {1, 1}, {-1, -1} , {-1, 1}, {1, -1} };

const long long mod = 1e9+7;
const long double eps = 1e-9;
const long long INF = LLONG_MAX;
const int inf = INT_MAX;
const int nn = 1e6+5;

int main()
{
    // IO;
    IOS;
    int n;
    cin >> n;
    int l[n], r[n];
    for(int i=0; i<n; i++) cin >> l[i];
    for(int i=0; i<n; i++) cin >> r[i];

    int ans[n];
    for(int i=0; i<n; i++){
        ans[i] = n - (l[i] + r[i]);       // rank of each i
    }
    for(int i=0; i<n; i++){
        int lft = 0, rt = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) lft++;
        }

        for(int j=i+1; j<n; j++){
            if(ans[j] > ans[i]) rt++;
        }
        if(lft != l[i] || rt != r[i]){
            cout << "NO";
            return 0;
        }
    }
    cout << "YES\n";
    for(int x : ans) cout << x << ' ';
    return 0;
}


/**
 *    Author:  "Robin Singh" !!!
 *    BrainyIsTheNewSexy     (CodeForces)
 *    rob_in_1               (Other OJs)
**/
#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define IO  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ff first
#define ss second
#define mp make_pair
#define szz(v) ((int)(v).size())
#define fr(i, j, k) for(int i = j; i < k; i++)
#define bk(i, j, k) for(int i = j-1; i >= k; i--)
#define mem(ptr)  memset(ptr, 0, sizeof ptr)
#define sbit(n)  __builtin_popcount(n)
#define nl "\n"
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector <int> vi;
typedef vector <long long> vll;
typedef vector < pair<int,int> > vpii;
typedef vector < pair<ll, ll> > vpll;

//---------------------------------------------*DEBUGGING*--------------------------------------------------------->]
#define dbg( args...) { vector<string> _v = split( #args, ','); err( _v.begin(), args); cerr << '\n'; }
vector<string> split( const string& s, char c) { vector<string> v; stringstream ss( s); string x;
while ( getline( ss, x, c)) v.emplace_back(x); return move(v); }
void err( vector<string>::iterator it) { }
template<typename T, typename... Args>
void err( vector<string>::iterator it, T a, Args... args) {
    cerr << it -> substr( ( *it)[0] == ' ', it -> length()) << " = " << a << '\t'; err( ++it, args...); }
//----------------------------------------------------------------------------------------------------------------->]
//*****************************************!Template Ends Here!*****************************************************]

const long long mod = 1e9+7;
const long double eps = 1e-9;
const long long INF = (1LL<<61);
const int inf = (1<<30);
const int nn = 1e6+5;

void NO(){
    cout << "NO";
    exit(0);
}

void update(){

}
int main()
{
    // IO;
    IOS;
    int n;
    cin >> n;
    int l[n], r[n];
    fr(i, 0, n) cin >> l[i];
    fr(i, 0, n) cin >> r[i];

    vi par[n+1];

    int ans[n];
    fill(ans, ans+n, 1);

    for(int i=0; i<n; i++){
        if(l[i] > i) NO();
        if(! l[i]) continue;
        int c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) {
                c++;
                par[i].pb(j);
            }
        }

        if(c > l[i]) NO();
        if(c == l[i]) continue;

        for(int j=i-1; j>=0; j--){
            if(ans[j] <= ans[i]){
                par[i].pb(j);
                ans[j] = 1 + max(ans[j], ans[i]);
                c++;
                queue <int> q;
                q.push(j);
                while(! q.empty()){
                    int x = q.front();
                    q.pop();
                    for(int x : par[j]){
                        ans[x] = max(ans[x], ans[j]) + 1;
                        if(szz(par[x])) q.push(x);
                    }
                }
                if(c == l[i]) break;
            }
        }
    }

    // fr(i, 0, n) dbg(ans[i]);
    // fr(i, 0, n) par[i].clear();
    vi par2[nn];

    for(int i = n-1; i >=0; i--){
        if(r[i] > n-1-i) NO();
        if(! r[i]) continue;
        int c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) {
                c++;
                par2[i].pb(j);
            }
        }

        if(c > r[i]) NO();
        if(c == r[i]) continue;

        for(int j=i-1; j>=0; j--){
            if(ans[j] <= ans[i]){
                par2[i].pb(j);
                ans[j] = 1 + max(ans[j], ans[i]);
                c++;
                queue <int> q;
                q.push(j);
                while(! q.empty()){
                    int x = q.front();
                    q.pop();
                    for(int x : par[j]){
                        ans[x] = max(ans[x], ans[j]) + 1;
                        if(szz(par[x])) q.push(x);
                    }
                }
                if(c == r[i]) break;
            }
        }
    }

    fr(i, 0, n){
        int c = 0;
        fr(j, i+1, n){
            if(ans[j] > ans[i]) c++;
        }
        if(c != r[i]) NO();
        c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) c++;
        }
        if(c != l[i]) NO();
    }

    cout << "YES\n";
    fr(i, 0, n) cout << ans[i] << ' ';
    return 0;
}


/**
 *    Author:  "Robin Singh" !!!
 *    BrainyIsTheNewSexy     (CodeForces)
 *    rob_in_1               (Other OJs)
**/
#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define IO  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ff first
#define ss second
#define mp make_pair
#define szz(v) ((int)(v).size())
#define fr(i, j, k) for(int i = j; i < k; i++)
#define bk(i, j, k) for(int i = j-1; i >= k; i--)
#define mem(ptr)  memset(ptr, 0, sizeof ptr)
#define sbit(n)  __builtin_popcount(n)
#define nl "\n"
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector <int> vi;
typedef vector <long long> vll;
typedef vector < pair<int,int> > vpii;
typedef vector < pair<ll, ll> > vpll;

//---------------------------------------------*DEBUGGING*--------------------------------------------------------->]
#define dbg( args...) { vector<string> _v = split( #args, ','); err( _v.begin(), args); cerr << '\n'; }
vector<string> split( const string& s, char c) { vector<string> v; stringstream ss( s); string x;
while ( getline( ss, x, c)) v.emplace_back(x); return move(v); }
void err( vector<string>::iterator it) { }
template<typename T, typename... Args>
void err( vector<string>::iterator it, T a, Args... args) {
    cerr << it -> substr( ( *it)[0] == ' ', it -> length()) << " = " << a << '\t'; err( ++it, args...); }
//----------------------------------------------------------------------------------------------------------------->]
//*****************************************!Template Ends Here!*****************************************************]

const long long mod = 1e9+7;
const long double eps = 1e-9;
const long long INF = (1LL<<61);
const int inf = (1<<30);
const int nn = 1e6+5;

void NO(){
    cout << "NO";
    exit(0);
}

int main()
{
    // IO;
    IOS;
    int n;
    cin >> n;
    int l[n], r[n];
    fr(i, 0, n) cin >> l[i];
    fr(i, 0, n) cin >> r[i];

    vi par[n+1];

    int ans[n];
    fill(ans, ans+n, 1);

    for(int i=0; i<n; i++){
        if(l[i] > i) NO();
        if(! l[i]) continue;
        int c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) {
                c++;
                par[i].pb(j);
            }
        }

        if(c > l[i]) NO();
        if(c == l[i]) continue;

        for(int j=i-1; j>=0; j--){
            if(ans[j] <= ans[i]){
                par[i].pb(j);
                ans[j] = 1 + max(ans[j], ans[i]);
                c++;

                for(int x : par[j]){
                    ans[x] = max(ans[x], ans[j]) + 1;
                }
                if(c == l[i]) break;
            }
        }
    }

    // fr(i, 0, n) dbg(ans[i]);
    // fr(i, 0, n) par[i].clear();
    vi par2[nn];

    for(int i = n-1; i>=0; i--){
        if(r[i] > n-1-i) NO();
        if(! r[i]) continue;
        int c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) {
                c++;
                par2[i].pb(j);
            }
        }

        if(c > r[i]) NO();
        if(c == r[i]) continue;

        for(int j=i-1; j>=0; j--){
            if(ans[j] <= ans[i]){
                par2[i].pb(j);
                ans[j] = 1 + max(ans[j], ans[i]);
                c++;

                for(int x : par2[j]){
                    ans[x] = max(ans[x], ans[j]) + 1;
                }
                if(c == r[i]) break;
            }
        }
    }

    fr(i, 0, n){
        int c = 0;
        fr(j, i+1, n){
            if(ans[j] > ans[i]) c++;
        }
        if(c != r[i]) NO();
        c = 0;
        for(int j=i-1; j>=0; j--){
            if(ans[j] > ans[i]) c++;
        }
        if(c != l[i]) NO();
    }

    cout << "YES\n";
    fr(i, 0, n) cout << ans[i] << ' ';
    return 0;
}