/**
 *    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];

    int par[n];
    memset(par, -1, sizeof par);
    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] = 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] = j;
                ans[j] = 1 + max(ans[j], ans[i]);
                c++;

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

    // fr(i, 0, n) dbg(ans[i]);
    memset(par, -1, sizeof par);

    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++;
                par[i] = j;
            }
        }

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

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

                int x = par[j];
                while(x != -1){
                    ans[x] = max(ans[x], ans[j]) + 1;
                    x = par[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);
}

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(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;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }   if(li[0]!=0||ri[n-1]!=0)
        {
            cout<<"NO";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=i-li[i]-1+n-ri[i]-i;
        }cout<<"YES\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }   if(li[0]!=0||ri[n-1]!=0)
        {
            cout<<"NO";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=i-li[i]-1+n-ri[i]-i;
        }cout<<"YES\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }   if(li[0]!=0||ri[n-1]!=0)
        {
            cout<<"NO";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=i-li[i]-1+n-ri[i]-i;
        }cout<<"YES\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }
        if(li[0]!=0||ri[n]!=0)
        {
            cout<<"NO";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=n-li[i]-2-ri[i];
            if(ai[i]<=0)
               {
                  cout<<"NO\n";
               }
        }cout<<"YES\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }
        if(li[0]!=0||ri[n]!=0)
        {
            cout<<"NO";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=n-li[i]-ri[i];
            if(ai[i]<=0)
               {
                  cout<<"NO\n";
                  return 0;
               }int left=0;
               for(int k=i-1;k>=1;k--)
               {
                   if(ai[k]>ai[i])
                   left++;
               }if(left!=li[i])
               {
                    cout<<"NO\n";
                  return 0;
               }
        } for(int i=1;i<=n;i++)
        {
            int right=0;
               for(int k=i+1;k<=n;k++)
               {
                   if(ai[k]>ai[i])
                   right++;
               }if(right!=ri[i])
               {
                    cout<<"NO\n";
                  return 0;
               }
        }
        cout<<"YES\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }
        if(li[0]!=0||ri[n]!=0)
        {
            cout<<"NO";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=n-li[i]-ri[i];
            if(ai[i]<=0)
               {
                  cout<<"NO\n";
               }
        }cout<<"YES\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }   if(li[0]!=0||ri[n-1]!=0)
        {
            cout<<"No";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=i-li[i]-1+n-ri[i]-i;
        }cout<<"Yes\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }
        if(li[0]!=0||ri[n-1]!=0)
        {
            cout<<"NO";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=n-li[i]-2-ri[i];
            if(ai[i]<=0)
               {
                  cout<<"NO\n";
               }
        }cout<<"YES\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int li[1003],ri[1003],ai[1003];
    for(int i=1;i<=n;i++)
    {
        cin>>li[i];
    }
    for(int i=1;i<=n;i++)
    {
        cin>>ri[i];

    }
        if(li[0]!=0||ri[n-1]!=0)
        {
            cout<<"NO";
            return 0;
        }
        for(int i=1;i<=n;i++)
        {
            ai[i]=i-li[i]-1+n-ri[i]-i;
            if(ai[i]<=0)
               {
                  cout<<"NO\n";
               }
        }cout<<"YES\n";
        for(int i=1;i<=n;i++)
        {
            cout<<ai[i]<<" ";
        }
}


#define _CRT_SECURE_NO_WARNINGS
//system("pause");
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<math.h>
#include<algorithm>
#include<cstring>
using namespace std;
const int MOD = 998244353;
int n, l[1007], r[1007], s[1007], tmp = -1, o[1007];
pair<int, int> ss[1007];
int main()
{
	//ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &l[i]);
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &r[i]);
		if (l[i] > i || r[i] > n - 1 - i)
			return !printf("NO\n");
		s[i] = l[i] + r[i];
		ss[i].first = s[i];
		ss[i].second = i;
		tmp = max(tmp, s[i]);
	}
	tmp++;
	sort(ss, ss + n);
	o[ss[0].second] = tmp;
	for (int i = 1; i < n; i++) {
		if (ss[i].first > ss[i - 1].first) tmp--;
		o[ss[i].second] = tmp;
	}
	printf("YES\n");
	for (int i = 0; i < n; i++)
		printf("%d ", o[i]);
//	system("pause");
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
//system("pause");
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<math.h>
#include<algorithm>
#include<cstring>
using namespace std;
const int MOD = 998244353;
int n, l[1007], r[1007], s[1007], tmp = -1, o[1007];
queue<int> qu;
int main()
{
	//ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &l[i]);
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &r[i]);
		s[i] = l[i] + r[i];
		tmp = max(tmp, s[i]);
	}
	tmp++;
	int t = 0;
	for (int i = 0; i < n; i++)
		if (s[i] == 0) {
			qu.push(i);
			o[i] = tmp;
			t++;
		}
	tmp--;
	while (!qu.empty()) {
		int x = qu.front();
		qu.pop();
		for (int i = 0; i < x; i++) {
			if (l[i] > 0 || r[i] > 0)
				r[i]--;
			else continue;
			if (r[i] < 0)
				return !printf("NO\n");
			if (l[i] == 0 && r[i] == 0) {
				qu.push(i);
				o[i] = tmp;
				t++;
				if (t == n) break;
			}
		}
		for (int i = x + 1; i < n; i++) {
			if (l[i] > 0 || r[i] > 0)
				l[i]--;
			else continue;
			if (l[i] < 0)
				return !printf("NO\n");
			if (l[i] == 0 && r[i] == 0) {
				qu.push(i);
				o[i] = tmp;
				t++;
				if (t == n) break;
			}
		}
		tmp--;
		if (t == n) break;
	}
	if (t < n)
		return !printf("NO\n");
	printf("YES\n");
	for (int i = 0; i < n; i++)
		printf("%d ", o[i]);
//	system("pause");
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<math.h>
#include<algorithm>
#include<cstring>
using namespace std;
int n, l[1007], r[1007], o[1007], tmp;
queue<int> qu;
bool vis[1007];
int main()
{
	scanf("%d", &n);
	tmp = n;
	for (int i = 0; i < n; i++)
		scanf("%d", &l[i]);
	for (int i = 0; i < n; i++)
		scanf("%d", &r[i]);
	for (int i = 0; i < n; i++)
		if (l[i] == 0 && r[i] == 0) {
			qu.push(i);
			vis[i] = true;
			o[i] = tmp;
		}
	tmp--;
	while (!qu.empty()) {
		int x = qu.front();
		qu.pop();
		for (int i = 0; i < x; i++) {
			if (!vis[i])
				r[i]--;
			else continue;
			if (r[i] < 0)
				return !printf("NO\n");

		}
		for (int i = x + 1; i < n; i++) {
			if (!vis[i])
				l[i]--;
			else continue;
			if (l[i] < 0)
				return !printf("NO\n");
		}
		if (qu.empty()) {
			for (int i = 0; i < n; i++) {
				if (l[i] == 0 && r[i] == 0 && !vis[i]) {
					qu.push(i);
					vis[i] = true;
					o[i] = tmp;
				}
			}
			tmp--;
		}
	}
	for (int i = 0; i < n; i++)
		if (!vis[i])
			return !printf("NO\n");
	printf("YES\n");
	for (int i = 0; i < n; i++)
		printf("%d ", o[i]);
//	system("pause");
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<math.h>
#include<algorithm>
#include<cstring>
using namespace std;
int n, l[1007], r[1007], o[1007], tmp = 1000;
queue<int> qu;
bool vis[1007];
int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%d", &l[i]);
	for (int i = 0; i < n; i++)
		scanf("%d", &r[i]);
	for (int i = 0; i < n; i++)
		if (l[i] == 0 && r[i] == 0) {
			qu.push(i);
			vis[i] = true;
			o[i] = tmp;
		}
	tmp--;
	while (!qu.empty()) {
		int x = qu.front();
		qu.pop();
		for (int i = 0; i < x; i++) {
			if (!vis[i])
				r[i]--;
			else continue;
			if (r[i] < 0)
				return !printf("NO\n");

		}
		for (int i = x + 1; i < n; i++) {
			if (!vis[i])
				l[i]--;
			else continue;
			if (l[i] < 0)
				return !printf("NO\n");
		}
		if (qu.empty()) {
			for (int i = 0; i < n; i++) {
				if (l[i] == 0 && r[i] == 0 && !vis[i]) {
					qu.push(i);
					vis[i] = true;
					o[i] = tmp;
				}
			}
			tmp--;
		}
	}
	for (int i = 0; i < n; i++)
		if (!vis[i])
			return !printf("NO\n");
	printf("YES\n");
	for (int i = 0; i < n; i++)
		printf("%d ", o[i]);
//	system("pause");
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
//system("pause");
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<math.h>
#include<algorithm>
#include<cstring>
using namespace std;
const int MOD = 998244353;
int n, l[1007], r[1007], s[1007], tmp = -1, o[1007];
queue<int> qu;
bool vis[1007];
int main()
{
	//ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &l[i]);
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &r[i]);
		s[i] = l[i] + r[i];
		tmp = max(tmp, s[i]);
	}
	tmp++;
	int t = 0;
	for (int i = 0; i < n; i++)
		if (s[i] == 0) {
			qu.push(i);
			vis[i] = true;
			o[i] = tmp;
			t++;
		}
	tmp--;
	while (!qu.empty()) {
		int x = qu.front();
		qu.pop();
		for (int i = 0; i < x; i++) {
			if (!vis[i])
				r[i]--;
			else continue;
			if (r[i] < 0)
				return !printf("NO\n");/*
			if (l[i] == 0 && r[i] == 0) {
				qu.push(i);
				vis[i] = true;
				o[i] = tmp;
				t++;
				if (t == n) break;
			}*/
		}
		for (int i = x + 1; i < n; i++) {
			if (!vis[i])
				l[i]--;
			else continue;
			if (l[i] < 0)
				return !printf("NO\n");/*
			if (l[i] == 0 && r[i] == 0) {
				qu.push(i);
				vis[i] = true;
				o[i] = tmp;
				t++;
				if (t == n) break;
			}*/
		}
		for (int i = 0; i < n; i++) {
			if (l[i] == 0 && r[i] == 0 && !vis[i]) {
				qu.push(i);
				vis[i] = true;
				o[i] = tmp;
				t++;
				if (t == n) break;
			}
		}
		tmp--;
		if (t == n) break;
	}
	if (t < n)
		return !printf("NO\n");
	printf("YES\n");
	for (int i = 0; i < n; i++)
		printf("%d ", o[i]);
//	system("pause");
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
//system("pause");
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<math.h>
#include<algorithm>
#include<cstring>
using namespace std;
const int MOD = 998244353;
int n, l[1007], r[1007], tmp = -1, o[1007];
queue<int> qu;
bool vis[1007];
int main()
{
	//ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &l[i]);
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &r[i]);
		tmp = max(tmp, l[i]+r[i]);
	}
	tmp++;
	int t = 0, sum = 0;
	for (int i = 0; i < n; i++)
		if (l[i]+r[i] == 0) {
			qu.push(i);
			sum++;
			vis[i] = true;
			o[i] = tmp;
			t++;
		}
	tmp--;
	while (!qu.empty()) {
		if (t == n) break;
		int x = qu.front();
		qu.pop();
		for (int i = 0; i < x; i++) {
			if (!vis[i])
				r[i]--;
			else continue;
			if (r[i] < 0)
				return !printf("NO\n");

		}
		for (int i = x + 1; i < n; i++) {
			if (!vis[i])
				l[i]--;
			else continue;
			if (l[i] < 0)
				return !printf("NO\n");
		}
		sum--;
		if (0 == sum) {
			for (int i = 0; i < n; i++) {
				if (l[i] == 0 && r[i] == 0 && !vis[i]) {
					qu.push(i);
					sum++;
					vis[i] = true;
					o[i] = tmp;
					t++;
					if (t == n) break;
				}
			}
			tmp--;
		}
	}
	if (t < n)
		return !printf("NO\n");
	printf("YES\n");
	for (int i = 0; i < n; i++)
		printf("%d ", o[i]);
//	system("pause");
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define fill(a,v) memset(a,v,sizeof a)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
ll i,j,n;
ll l[1005],r[1005];
ll vis[1005];
ll ans[1005];

ll l1[1005],r1[1005];
int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     cin>>n;
     for(i=0;i<n;i++)
     {
        cin>>l[i];
        l1[i]=l[i];
     }

     for(i=0;i<n;i++)
     {

        cin>>r[i];
        r1[i]=r[i];
     }
    ll mx=n;
    bool f=0;
    for(i=0;i<n;i++)
    {

        vector<ll>temp;
        for(j=0;j<n;j++)
        {
            if(l[j]==r[j] && l[j]==0 && !vis[j])
            {
                temp.pb(j);
                vis[j]=1;
                ans[j]=mx;
            }
        }

        for(j=0;j<temp.size();j++)
        {
            ll idx=temp[j];
           // cout<<idx<<endl;
            for(ll k=0;k<idx;k++)
            {
                if(!vis[k])
                {
                    r[k]--;
                }
            }
            for(ll k=idx+1;k<n;k++)
            {

                if(!vis[k])
                {
                    l[k]--;
                }
            }
        }

        mx--;
    }
    for(i=0;i<n;i++)
     {
        ll rt=0,lt=0;
        for(j=i+1;j<n;j++)
        {
            if(ans[j]>ans[i])
                rt++;
        }
        for(j=0;j<i;j++)
        {
            if(ans[j]>ans[i])
                lt++;
        }
        if(rt!=r1[i] && lt!=l1[i])
        {
            cout<<"NO";
            return 0;
        }
     }
    cout<<"YES"<<endl;
    for(i=0;i<n;i++)
        cout<<ans[i]<<" ";

  return 0;
  }


#include<bits/stdc++.h>
#define ll long long int
#define fill(a,v) memset(a,v,sizeof a)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
ll i,j,n;
ll l[1005],r[1005];
ll vis[1005];
ll ans[1005];
int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     cin>>n;
     for(i=0;i<n;i++)
        cin>>l[i];

     for(i=0;i<n;i++)
        cin>>r[i];
    ll mx=n;
    bool f=0;
    for(i=0;i<n;i++)
    {
        if(vis[i])
            continue;
        vector<ll>temp;
        for(j=0;j<n;j++)
        {
            if(l[j]==r[j] && l[j]==0 && !vis[j])
            {
                temp.pb(j);
                vis[j]=1;
                ans[j]=mx;
            }
        }
        for(j=0;j<temp.size();j++)
        {
            ll idx=temp[j];
            for(ll k=0;k<idx;k++)
            {
                if(!vis[k])
                {
                    if(r[k]<=0)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    r[k]--;
                }
            }
            for(ll k=idx+1;k<n;k++)
            {

                if(!vis[k])
                {
                    if(l[k]<=0)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    l[k]--;
                }
            }
        }
        mx--;
    }
    for(i=0;i<n;i++)
     {
        if(!vis[i] || ans[i]<=0 || l[i]>0 || r[i]>0)
        {
            cout<<"NO";
            return 0;
        }
     }
    cout<<"YES"<<endl;
    for(i=0;i<n;i++)
        cout<<ans[i]<<" ";

  return 0;
  }


#include<bits/stdc++.h>
#define ll long long int
#define fill(a,v) memset(a,v,sizeof a)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
ll i,j,n;
ll l[1005],r[1005];
ll vis[1005];
ll ans[1005];
int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     cin>>n;
     for(i=0;i<n;i++)
        cin>>l[i];

     for(i=0;i<n;i++)
        cin>>r[i];
    ll mx=n;
    for(i=0;i<n;i++)
    {
        if(vis[i])
            continue;
        ll idx=-1;
        vector<ll>temp;
        for(j=0;j<n;j++)
        {
            if(l[j]==r[j] && l[j]==0 && !vis[j])
            {
                temp.pb(j);
                vis[j]=1;
                ans[j]=mx;
            }
        }
        for(j=0;j<temp.size();j++)
        {
            ll idx=temp[j];
            for(ll k=0;k<idx;k++)
            {
                if(!vis[k] && r[k]>0)
                r[k]--;
            }
            for(ll k=idx+1;k<n;k++)
            {
                if(!vis[k] && l[k]>0)
                l[k]--;
            }
        }
        mx--;
    }
    for(i=0;i<n;i++)
     {
        if(!vis[i])
        {
            cout<<"NO";
            return 0;
        }
     }
    cout<<"YES"<<endl;
    for(i=0;i<n;i++)
        cout<<ans[i]<<" ";

  return 0;
  }


#include<bits/stdc++.h>
#define ll long long int
#define fill(a,v) memset(a,v,sizeof a)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
ll i,j,n;
ll l[1005],r[1005];
ll vis[1005];
ll ans[1005];
int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     cin>>n;
     for(i=0;i<n;i++)
        cin>>l[i];

     for(i=0;i<n;i++)
        cin>>r[i];
    ll mx=n;
    for(i=0;i<n;i++)
    {
        if(vis[i])
            continue;
        vector<ll>temp;
        for(j=0;j<n;j++)
        {
            if(l[j]==r[j] && l[j]==0 && !vis[j])
            {
                temp.pb(j);
                vis[j]=1;
                ans[j]=mx;
            }
        }
        if(temp.size()==0)
        {
            cout<<"NO";
            return 0;
        }
            ll idx1=temp[0];
            ll idx2=temp[temp.size()-1];
            for(ll k=0;k<idx2;k++)
            {
                if(!vis[k])
                {
                    if(r[k]<=0)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    r[k]--;
                }
            }
            for(ll k=idx1+1;k<n;k++)
            {

                if(!vis[k])
                {
                    if(l[k]<=0)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    l[k]--;
                }
            }
        mx--;
    }

    cout<<"YES"<<endl;
    for(i=0;i<n;i++)
        cout<<ans[i]<<" ";

  return 0;
  }


#include<bits/stdc++.h>
#define ll long long int
#define fill(a,v) memset(a,v,sizeof a)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
ll i,j,n;
ll l[1005],r[1005];
ll vis[1005];
ll ans[1005];

ll l1[1005],r1[1005];
int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     cin>>n;
     for(i=0;i<n;i++)
     {
        cin>>l[i];
        l1[i]=l[i];
     }

     for(i=0;i<n;i++)
     {

        cin>>r[i];
        r1[i]=r[i];
     }
    ll mx=n;
    bool f=0;
    for(i=0;i<n;i++)
    {

        vector<ll>temp;
        for(j=0;j<n;j++)
        {
            if(l[j]==r[j] && l[j]==0 && !vis[j])
            {
                temp.pb(j);
                vis[j]=1;
                ans[j]=mx;
            }
        }

        for(j=0;j<temp.size();j++)
        {
            ll idx=temp[j];
           // cout<<idx<<endl;
            for(ll k=0;k<idx;k++)
            {
                if(!vis[k])
                {
                    r[k]--;
                }
            }
            for(ll k=idx+1;k<n;k++)
            {

                if(!vis[k])
                {
                    l[k]--;
                }
            }
        }

        mx--;
    }
    for(i=0;i<n;i++)
     {
        ll rt=0,lt=0;
        for(j=i+1;j<n;j++)
        {
            if(ans[j]>ans[i])
                rt++;
        }
        for(j=0;j<i;j++)
        {
            if(ans[j]>ans[i])
                lt++;
        }
        if(rt!=r1[i] && lt!=l1[i] || ans[i]==0)
        {
            cout<<"NO";
            return 0;
        }
     }
    cout<<"YES"<<endl;
    for(i=0;i<n;i++)
        cout<<ans[i]<<" ";

  return 0;
  }


#include<bits/stdc++.h>
#define ll long long int
#define fill(a,v) memset(a,v,sizeof a)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
ll i,j,n;
ll l[1005],r[1005];
ll vis[1005];
ll ans[1005];
int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     cin>>n;
     for(i=0;i<n;i++)
        cin>>l[i];

     for(i=0;i<n;i++)
        cin>>r[i];
    ll mx=n;
    bool f=0;
    for(i=0;i<n;i++)
    {
        if(vis[i])
            continue;
        vector<ll>temp;
        for(j=0;j<n;j++)
        {
            if(l[j]==r[j] && l[j]==0 && !vis[j])
            {
                temp.pb(j);
                vis[j]=1;
                ans[j]=mx;
            }
        }
        for(j=0;j<temp.size();j++)
        {
            ll idx=temp[j];
            for(ll k=0;k<idx;k++)
            {
                if(!vis[k])
                {
                    if(r[k]<=0)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    r[k]--;
                }
            }
            for(ll k=idx+1;k<n;k++)
            {

                if(!vis[k])
                {
                    if(l[k]<=0)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    l[k]--;
                }
            }
        }
        mx--;
    }
    for(i=0;i<n;i++)
     {
        if(!vis[i] || ans[i]<=0)
        {
            cout<<"NO";
            return 0;
        }
     }
    cout<<"YES"<<endl;
    for(i=0;i<n;i++)
        cout<<ans[i]<<" ";

  return 0;
  }


#include<bits/stdc++.h>
#define ll long long int
#define fill(a,v) memset(a,v,sizeof a)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
ll i,j,n;
ll l[1005],r[1005];
ll vis[1005];
ll ans[1005];

ll l1[1005],r1[1005];
int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     cin>>n;
     for(i=0;i<n;i++)
     {
        cin>>l[i];
        l1[i]=l[i];
     }

     for(i=0;i<n;i++)
     {

        cin>>r[i];
        r1[i]=r[i];
     }
    ll mx=n;
    bool f=0;
    for(i=0;i<n;i++)
    {
        if(vis[i])
            continue;
        vector<ll>temp;
        for(j=0;j<n;j++)
        {
            if(l[j]==r[j] && l[j]==0 && !vis[j])
            {
                temp.pb(j);
                vis[j]=1;
                ans[j]=mx;
            }
        }
        for(j=0;j<temp.size();j++)
        {
            ll idx=temp[j];
            for(ll k=0;k<idx;k++)
            {
                if(!vis[k])
                {
                    r[k]--;
                }
            }
            for(ll k=idx+1;k<n;k++)
            {

                if(!vis[k])
                {
                    l[k]--;
                }
            }
        }
        mx--;
    }
    for(i=0;i<n;i++)
     {
        ll rt=0,lt=0;
        for(j=i+1;j<n;j++)
        {
            if(ans[j]>ans[i])
                rt++;
        }
        for(j=0;j<i;j++)
        {
            if(ans[j]>ans[i])
                lt++;
        }
        if(rt!=r1[i] && lt!=l1[i])
        {
            cout<<"NO";
            return 0;
        }
     }
    cout<<"YES"<<endl;
    for(i=0;i<n;i++)
        cout<<ans[i]<<" ";

  return 0;
  }


#include<bits/stdc++.h>
#define ll long long int
#define fill(a,v) memset(a,v,sizeof a)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
ll i,j,n;
ll l[1005],r[1005];
ll vis[1005];
ll ans[1005];
int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     cin>>n;
     for(i=0;i<n;i++)
        cin>>l[i];

     for(i=0;i<n;i++)
        cin>>r[i];
    ll mx=n;
    bool f=0;
    for(i=0;i<n;i++)
    {
        if(vis[i])
            continue;
        vector<ll>temp;
        for(j=0;j<n;j++)
        {
            if(l[j]==r[j] && l[j]==0 && !vis[j])
            {
                temp.pb(j);
                vis[j]=1;
                ans[j]=mx;
            }
        }
        for(j=0;j<temp.size();j++)
        {
            ll idx=temp[j];
            for(ll k=0;k<idx;k++)
            {
                if(!vis[k])
                {
                    if(r[k]<=0)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    r[k]--;
                }
            }
            for(ll k=idx+1;k<n;k++)
            {

                if(!vis[k])
                {
                    if(l[k]<=0)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    l[k]--;
                }
            }
        }
        mx--;
    }
    for(i=0;i<n;i++)
     {
        if(r[i]!=0 || l[i]!=0)
        {
            cout<<"NO";
            return 0;
        }
     }
    cout<<"YES"<<endl;
    for(i=0;i<n;i++)
        cout<<ans[i]<<" ";

  return 0;
  }


/*
Author: Sagar Gupta
E mail: sagar.june97p@gmail.com
*/
#include <bits/stdc++.h>
#define newline ("\n")
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int l[n+1] , r[n+1];
    for(int i= 1;i<=n;i++)
        cin >> l[i];
    for(int i= 1;i<=n;i++)
    {
        cin >> r[i];
    }
    int maxi = 0;
    for(int i = 1;i<=n;i++)
    {
        if(l[i] > i-1)
        {
            cout << "NO" ;
            return 0;
        }
        else if(r[i] > n-i)
        {
            cout << "NO";
            return 0;
        }
        if(i!= 1 && l[i] > l[i-1]+1)
        {
            cout << "NO";
            return 0;
        }
        if(i!=1 && r[i] > r[i-1] + 1)
        {
            cout << "NO";
            return 0;
        }
        maxi = max(l[i], r[i]);
    }
    maxi++;
    int res[n+1];
    for(int i = 1;i<=n;i++)
    {
        res[i] = maxi - l[i] - r[i];
    }

    for(int i = 1;i<=n;i++)
    {
        int lcount = 0;
        int rcount = 0;
        for(int left = 1;left < i;left++)
        {
            if(res[left] > res[i])
                lcount++;
        }
        for(int right = i+1;right<=n;right++)
        {
            if(res[right] > res[i])
                rcount++;
        }
        if(lcount != l[i])
        {
            cout << "NO";
            return 0;
        }
        if(rcount != r[i])
        {
            cout << "NO";
            return 0;
        }
    }

    cout <<"YES" <<endl;
    for(int i = 01;i<=n;i++)
    {
        cout << res[i] << " ";
    }

    return 0;
}


/*
Author: Sagar Gupta
E mail: sagar.june97p@gmail.com
*/
#include <bits/stdc++.h>
#define newline ("\n")
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int l[n+1] , r[n+1];
    for(int i= 1;i<=n;i++)
        cin >> l[i];
    for(int i= 1;i<=n;i++)
    {
        cin >> r[i];
    }
    int maxi = 0;
    for(int i = 1;i<=n;i++)
    {
        if(l[i] > i-1)
        {
            cout << "NO" ;
            return 0;
        }
        else if(r[i] > n-i)
        {
            cout << "NO";
            return 0;
        }
        maxi = max(l[i], r[i]);
    }
    maxi++;
    int res[n+1];
    for(int i = 1;i<=n;i++)
    {
        res[i] = maxi - l[i] - r[i];
    }

    cout <<"YES" <<endl;
    for(int i = 01;i<=n;i++)
    {
        cout << res[i] << " ";
    }

    return 0;
}


/*
Author: Sagar Gupta
E mail: sagar.june97p@gmail.com
*/
#include <bits/stdc++.h>
#define newline ("\n")
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int l[n+1] , r[n+1];
    for(int i= 1;i<=n;i++)
        cin >> l[i];
    for(int i= 1;i<=n;i++)
    {
        cin >> r[i];
    }
    int maxi = 0;
    for(int i = 1;i<=n;i++)
    {
        if(l[i] > i-1)
        {
            cout << "NO" ;
            return 0;
        }
        else if(r[i] > n-i)
        {
            cout << "NO";
            return 0;
        }
        if(i!= 1 && l[i] > l[i-1]+1)
        {
            cout << "NO";
            return 0;
        }
        if(i!=n && r[i] < r[i+1] - 1)
        {
            cout << "NO";
            return 0;
        }
        maxi = max(l[i], r[i]);
    }
    maxi++;
    int res[n+1];
    for(int i = 1;i<=n;i++)
    {
        res[i] = maxi - l[i] - r[i];
    }

    cout <<"YES" <<endl;
    for(int i = 01;i<=n;i++)
    {
        cout << res[i] << " ";
    }

    return 0;
}


/*
Author: Sagar Gupta
E mail: sagar.june97p@gmail.com
*/
#include <bits/stdc++.h>
#define newline ("\n")
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int l[n+1] , r[n+1];
    for(int i= 1;i<=n;i++)
        cin >> l[i];
    for(int i= 1;i<=n;i++)
    {
        cin >> r[i];
    }
    int maxi = 0;
    for(int i = 1;i<=n;i++)
    {
        if(l[i] > i-1)
        {
            cout << "NO" ;
            return 0;
        }
        else if(r[i] > n-i)
        {
            cout << "NO";
            return 0;
        }

        maxi = max(l[i] + r[i], maxi);
    }
    maxi++;
    int res[n+1];
    for(int i = 1;i<=n;i++)
    {
        res[i] = maxi - l[i] - r[i];
    }

    for(int i = 1;i<=n;i++)
    {
        int lcount = 0;
        int rcount = 0;
        for(int left = 1;left < i;left++)
        {
            if(res[left] > res[i])
                lcount++;
        }
        for(int right = i+1;right<=n;right++)
        {
            if(res[right] > res[i])
                rcount++;
        }
        if(lcount != l[i])
        {
            cout << "NO";
            return 0;
        }
        if(rcount != r[i])
        {
            cout << "NO";
            return 0;
        }
        if(res[i] > n || res[i] < 1)
        {
            cout << "NO";
            return 0;
        }
    }

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

    return 0;
}


/*
Author: Sagar Gupta
E mail: sagar.june97p@gmail.com
*/
#include <bits/stdc++.h>
#define newline ("\n")
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int l[n+1] , r[n+1];
    for(int i= 1;i<=n;i++)
        cin >> l[i];
    for(int i= 1;i<=n;i++)
    {
        cin >> r[i];
    }
    int maxi = 0;
    for(int i = 1;i<=n;i++)
    {
        if(l[i] > i-1)
        {
            cout << "NO" ;
            return 0;
        }
        else if(r[i] > n-i)
        {
            cout << "NO";
            return 0;
        }
        if(i!= 1 && l[i] > l[i-1]+1)
        {
            cout << "NO";
            return 0;
        }
        if(i!=1 && r[i] > r[i-1] + 1)
        {
            cout << "NO";
            return 0;
        }
        maxi = max(l[i] + r[i], maxi);
    }
    maxi++;
    int res[n+1];
    for(int i = 1;i<=n;i++)
    {
        res[i] = maxi - l[i] - r[i];
    }

    for(int i = 1;i<=n;i++)
    {
        int lcount = 0;
        int rcount = 0;
        for(int left = 1;left < i;left++)
        {
            if(res[left] > res[i])
                lcount++;
        }
        for(int right = i+1;right<=n;right++)
        {
            if(res[right] > res[i])
                rcount++;
        }
        if(lcount != l[i])
        {
            cout << "NO";
            return 0;
        }
        if(rcount != r[i])
        {
            cout << "NO";
            return 0;
        }
    }

    cout <<"YES" <<endl;
    for(int i = 01;i<=n;i++)
    {
        cout << res[i] << " ";
    }

    return 0;
}


/*
Author: Sagar Gupta
E mail: sagar.june97p@gmail.com
*/
#include <bits/stdc++.h>
#define newline ("\n")
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int l[n+1] , r[n+1];
    for(int i= 1;i<=n;i++)
        cin >> l[i];
    for(int i= 1;i<=n;i++)
    {
        cin >> r[i];
    }
    int maxi = 0;
    for(int i = 1;i<=n;i++)
    {
        if(l[i] > i-1)
        {
            cout << "NO" ;
            return 0;
        }
        else if(r[i] > n-i)
        {
            cout << "NO";
            return 0;
        }
        if(i!= 1 && l[i] > l[i-1]+1)
        {
            cout << "NO";
            return 0;
        }
        if(i!=1 && r[i] > r[i-1] + 1)
        {
            cout << "NO";
            return 0;
        }
        maxi = max(l[i] + r[i], maxi);
    }
    maxi++;
    int res[n+1];
    for(int i = 1;i<=n;i++)
    {
        res[i] = maxi - l[i] - r[i];
    }

    for(int i = 1;i<=n;i++)
    {
        int lcount = 0;
        int rcount = 0;
        for(int left = 1;left < i;left++)
        {
            if(res[left] > res[i])
                lcount++;
        }
        for(int right = i+1;right<=n;right++)
        {
            if(res[right] > res[i])
                rcount++;
        }
        if(lcount != l[i])
        {
            cout << "NO";
            return 0;
        }
        if(rcount != r[i])
        {
            cout << "NO";
            return 0;
        }
        if(res[i] > n || res[i] < 1)
        {
            cout << "NO";
            return 0;
        }
    }

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

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int l[n],r[n],a[n],p=1;
    vector<int> adj[n];
    for(int i=0 ; i<n ; i++)
        cin >> l[i];
    for(int i=0 ; i<n ; i++)
        cin >> r[i];

    if(n==1)
    {
        if(l[0]==0 && r[0]==0)
           {
             cout << "YES"<<endl;
            cout << "1";
           }
        else
            cout << "NO";
    return 0;
    }

    for(int i=0 ; i<n; i++)
        adj[n-1-(l[i]+r[i])].push_back(i);
    for(int i=0 ; i<n; i++)
    {
        if(adj[i].size()==0)
            continue;
        for(int j=0 ; j<adj[i].size() ; j++)
           a[adj[i][j]]=p;
        p++;
    }
   for(int i=0 ; i<n ; i++)
   {
       int g = a[i],c=0;
       for(int j=0 ; j<i ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(l[i]!=c)
       {
           cout << "NO";
           return 0;
       }
       c=0;
       for(int j=i+1 ; j<n ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(r[i]!=c)
       {
           cout << "NO";
           return 0;
       }
   }
   cout << "YES"<<endl;
   for(int i=0 ; i<n ; i++)
    cout << a[i]<<" ";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int l[n],r[n],a[n],p=1;
    vector<int> adj[n];
    for(int i=0 ; i<n ; i++)
        cin >> l[i];
    for(int i=0 ; i<n ; i++)
        cin >> r[i];

    if(n==1)
    {
        if(l[0]==0 && r[0]==0)
            cout << "YES"<<endl;
        cout << "1";
        else
            cout << "NO";
    }

    for(int i=0 ; i<n; i++)
        adj[n-1-(l[i]+r[i])].push_back(i);
    for(int i=0 ; i<n; i++)
    {
        if(adj[i].size()==0)
            continue;
        for(int j=0 ; j<adj[i].size() ; j++)
           a[adj[i][j]]=p;
        p++;
    }
   for(int i=0 ; i<n ; i++)
   {
       int g = a[i],c=0;
       for(int j=0 ; j<i ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(l[i]!=c)
       {
           cout << "NO";
           return 0;
       }
       c=0;
       for(int j=i+1 ; j<n ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(r[i]!=c)
       {
           cout << "NO";
           return 0;
       }
   }
   cout << "YES"<<endl;
   for(int i=0 ; i<n ; i++)
    cout << a[i]<<" ";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int l[n],r[n],a[n],p=1;
    vector<int> adj[n];
    for(int i=0 ; i<n ; i++)
        cin >> l[i];
    for(int i=0 ; i<n ; i++)
        cin >> r[i];

    if(n==1)
    {
        if(l[0]==0 && r[0]==0)
           {
             cout << "YES"<<endl;
            cout << "1";
           }
        else
            cout << "NO";
    }

    for(int i=0 ; i<n; i++)
        adj[n-1-(l[i]+r[i])].push_back(i);
    for(int i=0 ; i<n; i++)
    {
        if(adj[i].size()==0)
            continue;
        for(int j=0 ; j<adj[i].size() ; j++)
           a[adj[i][j]]=p;
        p++;
    }
   for(int i=0 ; i<n ; i++)
   {
       int g = a[i],c=0;
       for(int j=0 ; j<i ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(l[i]!=c)
       {
           cout << "NO";
           return 0;
       }
       c=0;
       for(int j=i+1 ; j<n ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(r[i]!=c)
       {
           cout << "NO";
           return 0;
       }
   }
   cout << "YES"<<endl;
   for(int i=0 ; i<n ; i++)
    cout << a[i]<<" ";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int l[n],r[n],a[n],p=1;
    vector<int> adj[n];
    for(int i=0 ; i<n ; i++)
        cin >> l[i];
    for(int i=0 ; i<n ; i++)
        cin >> r[i];

    for(int i=0 ; i<n; i++)
    {
        if(n-1-(l[i]+r[i])<0)
        {
            cout << "NO"<<endl;
            return 0;
        }
        adj[n-1-(l[i]+r[i])].push_back(i);
    }

    for(int i=0 ; i<n; i++)
    {
        if(adj[i].size()==0)
            continue;
        for(int j=0 ; j<adj[i].size() ; j++)
           a[adj[i][j]]=p;
        p++;
    }
   for(int i=0 ; i<n ; i++)
   {
       int g = a[i],c=0;
       for(int j=0 ; j<i ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(l[i]!=c)
       {
           cout << "NO";
           return 0;
       }
       c=0;
       for(int j=i+1 ; j<n ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(r[i]!=c)
       {
           cout << "NO";
           return 0;
       }
   }
   cout << "YES"<<endl;
   for(int i=0 ; i<n ; i++)
    cout << a[i]<<" ";
    return 0;
}


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

int main()
{
    int n;
    cin >> n;
    int l[n],r[n],a[n],p=1;
    vector<int> adj[n];
    for(int i=0 ; i<n ; i++)
        cin >> l[i];
    for(int i=0 ; i<n ; i++)
        cin >> r[i];

    for(int i=0 ; i<n; i++)
    {
        if(n-1-(l[i]+r[i])<0)
        {
            cout << "NO"<<endl;
            return 0;
        }
        adj[n-1-(l[i]+r[i])].push_back(i);
    }

    for(int i=0 ; i<n; i++)
    {
        if(adj[i].size()==0)
            continue;
        for(int j=0 ; j<adj[i].size() ; j++)
           a[adj[i][j]]=p;
        p++;
    }
   for(int i=0 ; i<n ; i++)
   {
       int g = a[i],c1=0,c2=0;
       for(int j=0 ; j<i ; j++)
       {
           if(a[j]>a[i])
            c1++;
       }
       for(int j=i+1 ; j<n ; j++)
       {
           if(a[j]>a[i])
            c2++;
       }
       if(l[i]!=c1 || r[i]!=c2)
       {
           cout << "NO";
           return 0;
       }
   }
   cout << "YES"<<endl;
   for(int i=0 ; i<n ; i++)
    cout << a[i]<<" ";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int l[n],r[n],a[n],p=1;
    vector<int> adj[n];
    for(int i=0 ; i<n ; i++)
        cin >> l[i];
    for(int i=0 ; i<n ; i++)
        cin >> r[i];
    for(int i=0 ; i<n; i++)
        adj[n-1-(l[i]+r[i])].push_back(i);
    for(int i=0 ; i<n; i++)
    {
        if(adj[i].size()==0)
            continue;
        for(int j=0 ; j<adj[i].size() ; j++)
           a[adj[i][j]]=p;
        p++;
    }
   for(int i=0 ; i<n ; i++)
   {
       int g = a[i],c=0;
       for(int j=0 ; j<i ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(l[i]!=c)
       {
           cout << "NO";
           return 0;
       }
       c=0;
       for(int j=i+1 ; j<n ; j++)
       {
           if(a[j]>a[i])
            c++;
       }
       if(r[i]!=c)
       {
           cout << "NO";
           return 0;
       }
   }
   cout << "YES"<<endl;
   for(int i=0 ; i<n ; i++)
    cout << a[i]<<" ";
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    vector<int> r(n);
    vector<int> v(n, 1);
    string answ = "YES";
    cin >> l[0];
    if (l[0] != 0) {
        answ = "NO";
    } else {
        for (int i = 1; i < n; ++i){
            cin >> l[i];
        }
    }
    cout << endl;
    if (answ != "NO") {
        for (int i = 0; i < n; ++i){
            cin >> r[i];
        }
        if (r[n - 1] != 0){
            answ = "NO";
        }
    }
    if (answ != "NO"){
        cout << "YES" << endl;
        for (int i = 0; i < n; ++i){
            cout << n - l[i] - r[i] << ' ';
        }
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    vector<int> r(n);
    vector<int> v(n, n);
    string answ = "YES";
    cin >> l[0];
    if (l[0] != 0) {
        answ = "NO";
    } else {
        for (int i = 1; i < n; ++i){
            cin >> l[i];
            v[i] -= l[i];
        }
    }
    if (answ != "NO") {
        for (int i = 0; i < n; ++i){
            cin >> r[i];
            v[i] -= r[i];
        }
        if (r[n - 1] != 0){
            answ = "NO";
        }

    }
    int count1, count2;
    if (answ != "NO"){
        for (int i = 0; i < n; ++i){
            count1 = 0;
            count2 = 0;
            for (int j = 0; j < i; ++j){
                if (v[j] > v[i]){
                    ++count1;
                }
            }
            if (count1 != l[i]){
                answ = "NO";
                break;
            }
            for (int j = i + 1; j < n; ++j){
                if (v[j] > v[i]){
                    ++count2;
                }
            }
            if (count2 != r[i]){
                answ = "NO";
                break;
            }
        }
        if (answ != "NO"){
            cout << "YES" << endl;
            for (auto i : v){
                cout << i << ' ';
            }
        } else {
            cout << "NO";
        }

    } else {
        cout << "NO";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    vector<int> r(n);
    vector<int> v(n, 1);
    string answ = "YES";
    cin >> l[0];
    if (l[0] != 0) {
        answ = "NO";
    } else {
        for (int i = 1; i < n; ++i){
            cin >> l[i];
        }
    }
    cout << endl;
    if (answ != "NO") {
        for (int i = 0; i < n; ++i){
            cin >> r[i];
        }
        if (r[n - 1] != 0){
            answ = "NO";
        }
    }
    if (answ != "NO"){
        cout << "YES" << endl;
        for (int i = 0; i < n; ++i){
            cout << n - l[i] - r[i] << ' ';
        }
    } else {
        cout << "NO";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    vector<int> r(n);
    vector<int> v(n, n);
    string answ = "YES";
    cin >> l[0];
    if (l[0] != 0) {
        answ = "NO";
    } else {
        for (int i = 1; i < n; ++i){
            cin >> l[i];
            v[i] -= l[i];
        }
    }
    if (answ != "NO") {
        for (int i = 0; i < n; ++i){
            cin >> r[i];
            v[i] -= r[i];
        }
        if (r[n - 1] != 0){
            answ = "NO";
        }
    }
    int count1, count2;
    if (answ != "NO"){
        for (int i = 1; i < n - 1; ++i){
            count1 = 0;
            count2 = 0;
            for (int j = 0; j < i; ++j){
                if (v[j] > v[i]){
                    ++count1;
                }
            }
            if (count1 != l[i]){
                answ = "NO";
                break;
            }
            for (int j = i + 1; j < n; ++j){
                if (v[j] > v[i]){
                    ++count2;
                }
            }
            if (count2 != r[i]){
                answ = "NO";
                break;
            }
        }
        if (answ != "NO"){
            cout << "YES" << endl;
            for (auto i : v){
                cout << i << ' ';
            }
        } else {
            cout << "NO";
        }

    } else {
        cout << "NO";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    vector<int> r(n);
    vector<int> v(n, 1);
    string answ = "YES";
    cin >> l[0];
    int s1 = l[0];
    int s2 = 0;
    if (l[0] != 0) {
        answ = "NO";
    } else {
        for (int i = 1; i < n; ++i){
            cin >> l[i];
            s1 += l[i];
        }
    }
    cout << endl;
    if (answ != "NO") {
        for (int i = 0; i < n; ++i){
            cin >> r[i];
            s2 += r[i];
        }
        if (r[n - 1] != 0){
            answ = "NO";
        }
    }
    if (s1 == s2){
        answ = "NO";
    }
    if (answ != "NO"){
        cout << "YES" << endl;
        for (int i = 0; i < n; ++i){
            cout << 1000 - l[i] - r[i] << ' ';
        }
    } else {
        cout << "NO";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    vector<int> r(n);
    vector<int> v(n, n);
    string answ = "YES";
    cin >> l[0];
    if (l[0] != 0) {
        answ = "NO";
    } else {
        for (int i = 1; i < n; ++i){
            cin >> l[i];
            v[i] -= l[i];
        }
    }
    cout << endl;
    if (answ != "NO") {
        for (int i = 0; i < n; ++i){
            cin >> r[i];
            v[i] -= r[i];
        }
        if (r[n - 1] != 0){
            answ = "NO";
        }
    }
    int count1, count2;
    if (answ != "NO"){
        for (int i = 1; i < n - 1; ++i){
            count1 = 0;
            count2 = 0;
            for (int j = 0; j < i; ++j){
                if (v[j] > v[i]){
                    ++count1;
                }
            }
            if (count1 != l[i]){
                cout << "NO";
                break;
            }
            for (int j = i + 1; j < n; ++j){
                if (v[j] > v[i]){
                    ++count2;
                }
            }
            if (count2 != r[i]){
                cout << "NO";
                break;
            }
        }
        cout << "YES" << endl;
        for (auto i : v){
            cout << i << ' ';
        }
    } else {
        cout << "NO";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    vector<int> r(n);
    vector<int> v(n, n);
    string answ = "YES";
    cin >> l[0];
    if (l[0] != 0) {
        answ = "NO";
    } else {
        for (int i = 1; i < n; ++i){
            cin >> l[i];
            v[i] -= l[i];
        }
    }
    if (answ != "NO") {
        for (int i = 0; i < n; ++i){
            cin >> r[i];
            v[i] -= r[i];
        }
        if (r[n - 1] != 0){
            answ = "NO";
        }

    }
    int count1, count2;
    if (answ != "NO"){
        for (int i = 0; i < n - 1; ++i){
            count1 = 0;
            count2 = 0;
            for (int j = 0; j < i; ++j){
                if (v[j] > v[i]){
                    ++count1;
                }
            }
            if (count1 != l[i]){
                answ = "NO";
                break;
            }
            for (int j = i + 1; j < n; ++j){
                if (v[j] > v[i]){
                    ++count2;
                }
            }
            if (count2 != r[i]){
                answ = "NO";
                break;
            }
        }
        if (answ != "NO"){
            cout << "YES" << endl;
            for (auto i : v){
                cout << i << ' ';
            }
        } else {
            cout << "NO";
        }

    } else {
        cout << "NO";
    }
    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<pair<ll, ll>, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	if (lr[0].first > 0 || lr[n - 1].second > 0)
	{
		cout << "NO";
		return 0;
	}

	ll minn = 1e9, mini;
	for (ll i = 0; i < n; i++)
	{
		if (lr[i].first + lr[i].second < minn)
		{
			mini = i;
			minn = lr[i].first + lr[i].second;
		}
	}

	for (ll i = 1; i < n; i++)
	{
		if (lr[i - 1].first == lr[i].first)
			ans[i].first.first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first.first = 1;
		else
			ans[i].first.first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].first.second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].first.second = 1;
		else
			ans[i].first.second = 2;

		if (i != n - 1 && ans[i].first.first == 1 && ans[i].first.second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first.first == 2 && ans[i].first.second == 1)
		{
			cout << "NO";
			return 0;
		}
	}

	ans[mini].second = 999;
	for (ll i = mini + 1; i < n; i++)
	{
		if (ans[i].first.first == 0 && ans[i].first.second == 0)
			ans[i].second = ans[i - 1].second;
		else if(ans[i].first.first == 1 || ans[i].first.second == 1)
			ans[i].second = ans[i - 1].second + 1;
		else
			ans[i].second = ans[i - 1].second - 1;
	}

	for (ll i = mini; i > 0; i--)
	{
			if (ans[i].first.first == 0 && ans[i].first.second == 0)
				ans[i - 1].second = ans[i].second;
			else if (ans[i].first.first == 1 || ans[i].first.second == 1)
				ans[i - 1].second = ans[i].second - 1;
			else
				ans[i - 1].second = ans[i].second + 1;
	}

	for (int i = 0; i < n; i++)
	{
		int cntr = 0;

		for (int j = i; j < n; j++)
		{
			if (ans[i].second < lr[j].second)
				cntr++;
		}
		ans[i].second -= lr[i].second - cntr;
		cntr = 0;
		for (int j = i; j > 0; j--)
		{
			if (ans[i].second < lr[j].first)
		     	cntr++;
		}
		ans[i].second -= lr[i].first - cntr;
	}
	cout << "YES" << endl;
	for (auto i : ans)
		cout << i.second << " ";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<pair<ll, ll>, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	if (n == 1)
	{
		cout << "YES" <<endl<< n;
		return 0;
	}
	if (lr[0].first > 0 || lr[n - 1].second > 0)
	{
		cout << "NO";
		return 0;
	}

	ll minn = 1e9, mini;
	for (ll i = 0; i < n; i++)
	{
		if (lr[i].first + lr[i].second < minn)
		{
			mini = i;
			minn = lr[i].first + lr[i].second;
		}
	}

	for (ll i = 1; i < n; i++)
	{
		if (lr[i - 1].first == lr[i].first)
			ans[i].first.first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first.first = 1;
		else
			ans[i].first.first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].first.second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].first.second = 1;
		else
			ans[i].first.second = 2;

		if (i != n - 1 && ans[i].first.first == 1 && ans[i].first.second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first.first == 2 && ans[i].first.second == 1)
		{
			cout << "NO";
			return 0;
		}
	}

	ans[mini].second = n;
	for (ll i = mini + 1; i < n; i++)
	{
		if (ans[i].first.first == 0 && ans[i].first.second == 0)
			ans[i].second = ans[i - 1].second;
		else if(ans[i].first.first == 1 || ans[i].first.second == 1)
			ans[i].second = ans[i - 1].second + 1;
		else
			ans[i].second = ans[i - 1].second - 1;
	}

	for (ll i = mini; i > 0; i--)
	{
			if (ans[i].first.first == 0 && ans[i].first.second == 0)
				ans[i - 1].second = ans[i].second;
			else if (ans[i].first.first == 1 || ans[i].first.second == 1)
				ans[i - 1].second = ans[i].second - 1;
			else
				ans[i - 1].second = ans[i].second + 1;
	}

	for (int i = 0; i < n; i++)
	{
		int cntr = 0;

		for (int j = i; j < n; j++)
		{
			if (ans[i].second < lr[j].second)
				cntr++;
		}
		ans[i].second -= lr[i].second - cntr;
		cntr = 0;
		for (int j = i; j > 0; j--)
		{
			if (ans[i].second < lr[j].first)
		     	cntr++;
		}
		ans[i].second -= lr[i].first - cntr;
	}
	cout << "YES" << endl;
	for (auto i : ans)
		cout << i.second << " ";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

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

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<ll, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	if (lr[0].first > 0 || lr[0].second > n - 1)
	{
		cout << "NO";
		return 0;
	}

	for (ll i = 1; i < n; i++)
	{
		if(lr[i].first > i || lr[i].second > n - i - 1)
		{
			cout << "NO";
			return 0;
		}

		if (lr[i - 1].first == lr[i].first)
			ans[i].first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first = 1;
		else
			ans[i].first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].second = 1;
		else
			ans[i].second = 2;

		if (i != n - 1 && ans[i].first == 1 && ans[i].second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first == 2 && ans[i].second == 1)
		{
			cout << "NO";
			return 0;
		}
	}
	cout << "YES" << endl;
	for (int i = 0; i < n; i++)
		cout << n - lr[i].first - lr[i].second <<" ";

	return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <stack>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#define ll long long
#define ui unsigned ll
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
using namespace std;
#define _CRT_SECURE_NO_WARNINGS

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	//freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<ll> l(n);
	vector<ll> r(n);
	vector<ll> ans(n);
	for (ll i = 0; i < n; i++)
		cin >> l[i];
	for (ll i = 0; i < n; i++)
		cin >> r[i];
	ll m = 0;
	for (ll i = 0; i < n; i++)
		m = max(m, l[i] + r[i] + 1);

	for (ll i = 0; i < n; i++)
		ans[i] = m - l[i] - r[i];

	for (ll i = 0; i < n; i++)
	{
		ll left = 0, right = 0;
		for (ll j = 0; j < i; j++)
			if (ans[j] > ans[i])
				left++;
		for (ll j = i + 1; j < n; j++)
			if (ans[j] > ans[i])
				right++;
		if (left != l[i] || right != r[i])
		{
			cout << "NO";
			return 0;
		}
	}
	cout << "YES" << endl;
	for (ll i = 0; i < n; i++)
		cout << ans[i] << " ";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

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

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<ll, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	for (ll i = 1; i < n; i++)
	{
		if(lr[i].first > i && lr[0].first > n - i - 1)
		{
			cout << "NO";
			return 0;
		}

		if (lr[i - 1].first == lr[i].first)
			ans[i].first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first = 1;
		else
			ans[i].first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].second = 1;
		else
			ans[i].second = 2;

		if (i != n - 1 && ans[i].first == 1 && ans[i].second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first == 2 && ans[i].second == 1)
		{
			cout << "NO";
			return 0;
		}
	}
	cout << "YES" << endl;
	for (int i = 0; i < n; i++)
		cout << n - lr[i].first - lr[i].second <<" ";

	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<pair<ll, ll>, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	if (lr[0].first > 0 || lr[n - 1].second > 0)
	{
		cout << "NO";
		return 0;
	}

	ll minn = 1e9, mini;
	for (ll i = 0; i < n; i++)
	{
		if (lr[i].first + lr[i].second < minn)
		{
			mini = i;
			minn = lr[i].first + lr[i].second;
		}
	}

	for (ll i = 1; i < n; i++)
	{
		if (lr[i - 1].first == lr[i].first)
			ans[i].first.first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first.first = 1;
		else
			ans[i].first.first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].first.second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].first.second = 1;
		else
			ans[i].first.second = 2;

		if (i != n - 1 && ans[i].first.first == 1 && ans[i].first.second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first.first == 2 && ans[i].first.second == 1)
		{
			cout << "NO";
			return 0;
		}
	}

	ans[mini].second = 999;
	for (ll i = mini + 1; i < n; i++)
	{
		if (ans[i].first.first == 0 && ans[i].first.second == 0)
			ans[i].second = ans[i - 1].second;
		else if(ans[i].first.first == 1 || ans[i].first.second == 1)
			ans[i].second = ans[i - 1].second + 1;
		else
			ans[i].second = ans[i - 1].second - 1;
	}

	for (ll i = mini; i > 0; i--)
	{
			if (ans[i].first.first == 0 && ans[i].first.second == 0)
				ans[i - 1].second = ans[i].second;
			else if (ans[i].first.first == 1 || ans[i].first.second == 1)
				ans[i - 1].second = ans[i].second - 1;
			else
				ans[i - 1].second = ans[i].second + 1;
	}
	cout << "YES" << endl;
	for (auto i : ans)
		cout << i.second << " ";
	return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <stack>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#define ll long long
#define ui unsigned ll
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
using namespace std;
#define _CRT_SECURE_NO_WARNINGS

using namespace std;

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

	ll n; cin >> n;
	vector<ll> l(n);
	vector<ll> r(n);

	for (ll i = 0; i < n; i++)
		cin >> l[i];
	for (ll i = 0; i < n; i++)
		cin >> r[i];

	ll m = 0;
	for (ll i = 1; i < n; i++)
	{
		if (l[i] > l[i - 1] && r[i] < r[i - 1])
		{
			cout << "NO";
			return 0;
		}
		if (l[i] < l[i - 1] && r[i] > r[i - 1])
		{
			cout << "NO";
			return 0;
		}
		m = max(m, l[i] + r[i]);
	}
	if (r[n - 1] > 0 || l[0] > 0)
	{
		cout << "NO" << endl;
		return 0;
	}

	cout << "YES" << endl;
	for (ll i = 0; i < n; i++)
		cout << m - l[i] - r[i] + 1 << " ";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<pair<ll, ll>, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	if (lr[0].first > 0 || lr[n - 1].second > 0)
	{
		cout << "NO";
		return 0;
	}

	ll minn = 1e9, mini;
	for (ll i = 0; i < n; i++)
	{
		if (lr[i].first + lr[i].second < minn)
		{
			mini = i;
			minn = lr[i].first + lr[i].second;
		}
	}

	for (ll i = 1; i < n; i++)
	{
		if (lr[i - 1].first == lr[i].first)
			ans[i].first.first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first.first = 1;
		else
			ans[i].first.first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].first.second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].first.second = 1;
		else
			ans[i].first.second = 2;

		if (i != n - 1 && ans[i].first.first == 1 && ans[i].first.second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first.first == 2 && ans[i].first.second == 1)
		{
			cout << "NO";
			return 0;
		}
	}

	ans[mini].second = 999;
	for (ll i = mini + 1; i < n; i++)
	{
		if (ans[i].first.first == 0 && ans[i].first.second == 0)
			ans[i].second = ans[i - 1].second;
		else if(ans[i].first.first == 1 || ans[i].first.second == 1)
			ans[i].second = ans[i - 1].second + 1;
		else
			ans[i].second = ans[i - 1].second - 1;
	}

	for (ll i = mini; i > 0; i--)
	{
			if (ans[i].first.first == 0 && ans[i].first.second == 0)
				ans[i - 1].second = ans[i].second;
			else if (ans[i].first.first == 1 || ans[i].first.second == 1)
				ans[i - 1].second = ans[i].second - 1;
			else
				ans[i - 1].second = ans[i].second + 1;
	}
	cout << "YES" << endl;
	for (auto i : ans)
		cout << i.second << " ";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<pair<ll, ll>, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	if (lr[0].first > 0 || lr[n - 1].second > 0)
	{
		cout << "NO";
		return 0;
	}

	ll minn = 1e9, mini;
	for (ll i = 0; i < n; i++)
	{
		if (lr[i].first + lr[i].second < minn)
		{
			mini = i;
			minn = lr[i].first + lr[i].second;
		}
	}

	for (ll i = 1; i < n; i++)
	{
		if (lr[i - 1].first == lr[i].first)
			ans[i].first.first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first.first = 1;
		else
			ans[i].first.first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].first.second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].first.second = 1;
		else
			ans[i].first.second = 2;

		if (i != n - 1 && ans[i].first.first == 1 && ans[i].first.second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first.first == 2 && ans[i].first.second == 1)
		{
			cout << "NO";
			return 0;
		}
	}

	ans[mini].second = 999;
	for (ll i = mini + 1; i < n; i++)
	{
		if (ans[i].first.first == 0 && ans[i].first.second == 0)
			ans[i].second = ans[i - 1].second;
		else if(ans[i].first.first == 1 || ans[i].first.second == 1)
			ans[i].second = ans[i - 1].second + 1;
		else
			ans[i].second = ans[i - 1].second - 1;
	}

	for (ll i = mini; i > 0; i--)
	{
			if (ans[i].first.first == 0 && ans[i].first.second == 0)
				ans[i - 1].second = ans[i].second;
			else if (ans[i].first.first == 1 || ans[i].first.second == 1)
				ans[i - 1].second = ans[i].second - 1;
			else
				ans[i - 1].second = ans[i].second + 1;
	}

	for (auto i : ans)
		cout << i.second << " ";
	return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <stack>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#define ll long long
#define ui unsigned ll
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
using namespace std;
#define _CRT_SECURE_NO_WARNINGS

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	//freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<ll> l(n);
	vector<ll> r(n);

	for (ll i = 0; i < n; i++)
		cin >> l[i];
	for (ll i = 0; i < n; i++)
		cin >> r[i];

	ll m = 0;
	bool flag = 0;

	flag = (l[0] + r[0] == 0);

	for (ll i = 1; i < n; i++)
	{
		if (l[i] > l[i - 1] && r[i] < r[i - 1])
		{
			cout << "NO";
			return 0;
		}
		if (l[i] < l[i - 1] && r[i] > r[i - 1])
		{
			cout << "NO";
			return 0;
		}
		if (l[i] + r[i] == 0)
			flag = 1;
		m = max(m, l[i] + r[i]);
	}
	if (r[n - 1] > 0 || l[0] > 0 || flag == 0)
	{
		cout << "NO" << endl;
		return 0;
	}

	cout << "YES" << endl;
	for (ll i = 0; i < n; i++)
		cout << m - l[i] - r[i] + 1 << " ";
	return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <stack>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#define ll long long
#define ui unsigned ll
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
using namespace std;
#define _CRT_SECURE_NO_WARNINGS

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<ll> l(n);
	vector<ll> r(n);

	for (ll i = 0; i < n; i++)
		cin >> l[i];
	for (ll i = 0; i < n; i++)
		cin >> r[i];

	ll m = 0;
	bool flag = 0;

	flag = (l[0] + r[0] == 0);

	for (ll i = 1; i < n; i++)
	{
		if (l[i] > l[i - 1] && r[i] < r[i - 1])
		{
			cout << "NO";
			return 0;
		}
		if (l[i] < l[i - 1] && r[i] > r[i - 1])
		{
			cout << "NO";
			return 0;
		}
		if (l[i] + r[i] == 0)
			flag = 1;
		m = max(m, l[i] + r[i]);
	}
	if (r[n - 1] > 0 || l[0] > 0 || flag == 0)
	{
		cout << "NO" << endl;
		return 0;
	}

	cout << "YES" << endl;
	for (ll i = 0; i < n; i++)
		cout << m - l[i] - r[i] + 1 << " ";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

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

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<ll, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	for (ll i = 1; i < n; i++)
	{
		if(lr[i].first > i && lr[0].first > n - i - 1)
		{
			cout << "NO";
			return 0;
		}

		if (lr[i - 1].first == lr[i].first)
			ans[i].first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first = 1;
		else
			ans[i].first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].second = 1;
		else
			ans[i].second = 2;

		if (i != n - 1 && ans[i].first == 1 && ans[i].second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first == 2 && ans[i].second == 1)
		{
			cout << "NO";
			return 0;
		}
	}

	for (int i = 0; i < n; i++)
		cout << n - lr[i].first - lr[i].second <<" ";

	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#define ll long long
using namespace std;

//0 - равны
//1 - число справа больше
//2 - число справа меньше

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	//freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<pair<ll, ll>> lr(n);
	vector<pair<pair<ll, ll>, ll>> ans(n);

	for (ll i = 0; i < n; i++)
		cin >> lr[i].first;
	for (ll i = 0; i < n; i++)
		cin >> lr[i].second;

	if (lr[0].first > 0 || lr[n - 1].second > 0)
	{
		cout << "NO";
		return 0;
	}

	ll minn = 1e9, mini;
	for (ll i = 0; i < n; i++)
	{
		if (lr[i].first + lr[i].second < minn)
		{
			mini = i;
			minn = lr[i].first + lr[i].second;
		}
	}

	for (ll i = 1; i < n; i++)
	{
		if (lr[i - 1].first == lr[i].first)
			ans[i].first.first = 0;
		else if(lr[i-1].first > lr[i].first)
			ans[i].first.first = 1;
		else
			ans[i].first.first = 2;

		if (lr[i - 1].second == lr[i].second)
			ans[i].first.second = 0;
		else if (lr[i - 1].second > lr[i].second)
			ans[i].first.second = 1;
		else
			ans[i].first.second = 2;

		if (i != n - 1 && ans[i].first.first == 1 && ans[i].first.second == 2)
		{
			cout << "NO";
			return 0;
		}
		if (i != n - 1 && ans[i].first.first == 2 && ans[i].first.second == 1)
		{
			cout << "NO";
			return 0;
		}
	}

	ans[mini].second = n;
	for (ll i = mini + 1; i < n; i++)
	{
		if (ans[i].first.first == 0 && ans[i].first.second == 0)
			ans[i].second = ans[i - 1].second;
		else if(ans[i].first.first == 1 || ans[i].first.second == 1)
			ans[i].second = ans[i - 1].second + 1;
		else
			ans[i].second = ans[i - 1].second - 1;
	}

	for (ll i = mini; i > 0; i--)
	{
			if (ans[i].first.first == 0 && ans[i].first.second == 0)
				ans[i - 1].second = ans[i].second;
			else if (ans[i].first.first == 1 || ans[i].first.second == 1)
				ans[i - 1].second = ans[i].second - 1;
			else
				ans[i - 1].second = ans[i].second + 1;
	}

	for (int i = 0; i < n; i++)
	{
		int cntr = 0;

		for (int j = i; j < n; j++)
		{
			if (ans[i].second < lr[j].second)
				cntr++;
		}
		ans[i].second -= lr[i].second - cntr;
		cntr = 0;
		for (int j = i; j > 0; j--)
		{
			if (ans[i].second < lr[j].first)
		     	cntr++;
		}
		ans[i].second -= lr[i].first - cntr;
	}
	cout << "YES" << endl;
	for (auto i : ans)
		cout << i.second << " ";
	return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <stack>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <iomanip>
#define ll long long
#define ui unsigned ll
#define MP make_pair
#define timer fghge
#define y1 yjyjyju
#define all(X) (X).begin(), (X).end()
using namespace std;
#define _CRT_SECURE_NO_WARNINGS

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	//freopen("input.txt", "r", stdin);

	ll n; cin >> n;
	vector<ll> l(n);
	vector<ll> r(n);

	for (ll i = 0; i < n; i++)
		cin >> l[i];
	for (ll i = 0; i < n; i++)
		cin >> r[i];

	ll m = 0;
	bool flag = 0;

	flag = (l[0] + r[0] == 0);

	for (ll i = 1; i < n; i++)
	{
		if (l[i] > l[i - 1] && r[i] < r[i - 1])
		{
			cout << "NO";
			return 0;
		}
		if (l[i] < l[i - 1] && r[i] > r[i - 1])
		{
			cout << "NO";
			return 0;
		}
		if(r[i] > n - i - 1 || l[i] > i)
		{
			cout << "NO";
			return 0;
		}

		if (l[i] + r[i] == 0)
			flag = 1;

		m = max(m, l[i] + r[i]);
	}
	if (l[0] > 0 || r[0] > n - 1 || flag == 0)
	{
		cout << "NO" << endl;
		return 0;
	}

	cout << "YES" << endl;
	for (ll i = 0; i < n; i++)
		cout << m - l[i] - r[i] + 1 << " ";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define db double
#define ldb long double
#define rep(i,a,b) for(i=a;i<=b;i++)
#define rev(i,a,b) for(i=b;i>=a;i--)
#define gcd(a,b) __gcd(a,b)
#define MOD 1000000007
#define scll(t) scanf("%lld",&t)
#define sclf(t) scanf("%lf", &t)
#define scst(t) scanf("%s", &t)
#define max(a,b) (a>=b?a:b)
#define min(a,b) (a<b?a:b)
#define MEM(a,b) memset(a, (b), sizeof(a))
#define all(v) v.begin(), v.end()
const double pi=acos(-1.0);
typedef pair<ll, ll> PII;
typedef vector<ll> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<ll,ll> MPII;
typedef set<ll> SETI;
typedef multiset<int> MSETI;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;

template <typename T> inline void write(T x)
{
	ll i = 20;
	char buf[21];
	// buf[10] = 0;
	buf[20] = '\n';

	do
	{
		buf[--i] = x % 10 + '0';
		x/= 10;
	}while(x);
	do
	{
		putchar(buf[i]);
	} while (buf[i++] != '\n');
}

void read(ll &x)
{
    bool neg=false;
    register ll c;
    x =0;
    c=getchar();
    if(c=='-')
    {
        neg = true;
        c=getchar();
    }
    for(;(c>47 && c<58);c=getchar())
        x = (x<<1) + (x<<3) +c -48;
    if(neg)
        x *=-1;
}

int main()
{
	int n;
	cin>>n;
	ll l[n], r[n];
	for(int i=0;i<n;i++){
        cin>>l[i];
	}
	for(int i=0;i<n;i++){
        cin>>r[i];
	}
	ll cnt[n],maxm=INT_MIN;
	for(int i=0;i<n;i++){
        if(l[i]>i){
            cout<<"NO\n";
            return 0;
        }
        else if(r[i]>n-i-1){
            cout<<"NO\n";
            return 0;
        }
        cnt[i] = (l[i] + r[i] + 1);
        maxm = max(maxm, cnt[i]);
	}
    ll sec[n];
	for(int i=0;i<n;i++){
     //   cnt[i] += abs(minm)+1;
     //   cout<<cnt[i]<<endl;
        sec[i] = cnt[i];
	}
	sort(sec, sec+n);
	ll pre = 1;
	for(int i=0;i<n;i++){
        if(sec[i] == pre){
            continue;
        }
        else if(sec[i] == i+1){
            pre = sec[i];
        }
        else {
            cout<<"NO\n";
            return 0;
        }
	}
	cout<<"YES\n";
	for(int  i=0;i<n;i++){
        cout<<(-cnt[i] + maxm + 1)<<" ";
	}

	return 0;
}


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

public class Main {

	static long sx = 0, sy = 0, mod = (long) (1e9 + 7);

	static ArrayList<Integer>[] a;
	static long[][][] dp;
	static int[] size;
	static long[] farr;
	public static PrintWriter out;
	static ArrayList<pair> pa = new ArrayList<>();
	static long[] fact = new long[(int) 1e6];
	static boolean b = false;
	static StringBuilder sb = new StringBuilder();
	static boolean cycle = false;
	// static long m = 998244353;
	static long[] no, col;
	static String s;
	static int k = 0, n = 0, m = 0;
	static int[] c;
	static long ans = 0;
	static HashMap<Integer, Integer> hm;
	static ArrayList<Integer> p = new ArrayList<>();

	public static void main(String[] args) throws IOException {

		Scanner scn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));

		out = new PrintWriter(System.out);
		// Reader scn = new Reader();

		int te = scn.nextInt();

		while (te-- != 0) {

			int n = scn.nextInt(), k = scn.nextInt();

			if (k % 3 != 0) {

				if (n % 3 == 0)
					System.out.println("Bob");
				else
					System.out.println("Alice");

			}

			else {

				int x = n % (k + 1);

				if (x != k && x % 3 == 0)
					System.out.println("Bob");
				else
					System.out.println("Alice");
			}
		}

	}

	private static boolean seq(String s, String t) {

		int i = 0, j = 0;

		while (i < s.length() && j < t.length()) {

			if (s.charAt(i) == t.charAt(j)) {
				i++;
				j++;
			}

			else
				j++;
		}

		return i == s.length();
	}

	// _________________________TEMPLATE_____________________________________________________________

	// public static long lcm(long x, long y) {
	//
	// return (x * y) / gcd(x, y);
	// }
	//
	// private static long gcd(long x, long y) {
	// if (x == 0)
	// return y;
	//
	// return gcd(y % x, x);
	// }

	// static class comp implements Comparator<pair> {
	//
	// @Override
	// public int compare(pair p1, pair p2) {
	// return p1.ele - p2.ele;
	// }
	//
	// }
	//
	// public static long pow(long a, long b) {
	//
	// if (b < 0)
	// return 0;
	// if (b == 0 || b == 1)
	// return (long) Math.pow(a, b);
	//
	// if (b % 2 == 0) {
	//
	// long ret = pow(a, b / 2);
	// ret = (ret % mod * ret % mod) % mod;
	// return ret;
	// }
	//
	// else {
	// return ((pow(a, b - 1) % mod) * a % mod) % mod;
	// }
	// }

	private static class pair implements Comparable<pair> {

		int cnt;
		int p;
		int x;

		pair(int a, int b, int c) {

			cnt = a;
			p = b;
			x = c;

		}

		@Override
		public int compareTo(pair o) {

			return 1;
		}

	}

	private static String reverse(String s) {

		return new StringBuilder(s).reverse().toString();
	}

	public 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[1000000 + 1]; // 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();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		public int[][] nextInt2DArray(int m, int n) throws IOException {
			int[][] arr = new int[m][n];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < n; j++)
					arr[i][j] = nextInt();
			}
			return arr;
		}

		public long[][] nextInt2DArrayL(int m, int n) throws IOException {
			long[][] arr = new long[m][n];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < n; j++)
					arr[i][j] = nextInt();
			}
			return arr;
		}
		// kickstart - Solution
		// atcoder - Main
	}

}


import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class e
{
    public static void print(String str,long val){
        System.out.println(str+"  "+val);
    }

    public long gcd(long a, long b) {
        if (b==0L) return a;
        return gcd(b,a%b);
    }

    public static void debug(long[][] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.println(Arrays.toString(arr[i]));
        }
    }
    public static void debug(int[][] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.println(Arrays.toString(arr[i]));
        }
    }
    public static void debug(String[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.println(arr[i]);
        }
    }

    public static void print(int[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.print(arr[i]+" ");
        }
        System.out.print('\n');
    }

    public static void print(Object[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.print(arr[i]+" ");
        }
        System.out.print('\n');
    }
    public static void print(String[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.print(arr[i]+" ");
        }
        System.out.print('\n');
    }
    public static void print(long[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.print(arr[i]+" ");
        }
        System.out.print('\n');
    }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }
        public FastReader(String path) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(path));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

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

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args)
    {
        FastReader s=new FastReader();
        int t = s.nextInt();
        for(int tt=0;tt<t;tt++){
            int n = s.nextInt();
            int k = s.nextInt();
            if(k%3!=0){
                if(n%3==0){
                    System.out.println("Bob");
                }
                else {
                    System.out.println("Alice");
                }
            }
            else {
                int np = n%(k+1);
                if(np==0 && np!=k){
                    System.out.println("Bob");
                }
                else {
                    System.out.println("Alice");
                }
            }
        }

    }

//    OutputStream out = new BufferedOutputStream( System.out );
//        for(int i=1;i<n;i++){
//              out.write((arr[i]+" ").getBytes());
//         }
//        out.flush();
//  long start_time = System.currentTimeMillis();
//  long end_time = System.currentTimeMillis();
//  System.out.println((end_time - start_time) + "ms");

}


import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class e
{
    public static void print(String str,int val){
        System.out.println(str+"  "+val);
    }

    public long gcd(long a, long b) {
        if (b==0L) return a;
        return gcd(b,a%b);
    }

    public static void debug(long[][] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.println(Arrays.toString(arr[i]));
        }
    }
    public static void debug(int[][] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.println(Arrays.toString(arr[i]));
        }
    }
    public static void debug(String[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.println(arr[i]);
        }
    }

    public static void print(int[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.print(arr[i]+" ");
        }
        System.out.print('\n');
    }
    public static void print(String[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.print(arr[i]+" ");
        }
        System.out.print('\n');
    }
    public static void print(long[] arr){
        int len = arr.length;
        for(int i=0;i<len;i++){
            System.out.print(arr[i]+" ");
        }
        System.out.print('\n');
    }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }
        public FastReader(String path) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(path));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

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

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args)
    {
        FastReader s=new FastReader();
        int t = s.nextInt();
        for(int tt=0;tt<t;tt++){
            int n = s.nextInt();
            int k= s.nextInt();
            if(n==0){
                System.out.println("Bob");
            }
            else{
                if(n<=k && n!=3){
                    System.out.println("Alice");
                }
                else if(n==3){
                    if(k==3){
                        System.out.println("Alice");
                    }
                    else {
                        System.out.println("Bob");
                    }
                }
                else {
                    int num = (n/k);
                    int rem = (n%k);
                    if(num%2==0){
                        if(rem==0 || rem==3){
                            System.out.println("Bob");
                        }
                        else {
                            System.out.println("Alice");
                        }
                    }
                    else {
                        if(rem!=0 && rem!=3){
                            System.out.println("Bob");
                        }
                        else {
                            System.out.println("Alice");
                        }
                    }
                }
            }
        }

    }

//    OutputStream out = new BufferedOutputStream( System.out );
//        for(int i=1;i<n;i++){
//              out.write((arr[i]+" ").getBytes());
//         }
//        out.flush();
//  long start_time = System.currentTimeMillis();
//  long end_time = System.currentTimeMillis();
//  System.out.println((end_time - start_time) + "ms");

}