n=int(input()); c=[]; d=[]; a1=[]; b1=[]; check=1
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n): c.append(a[i]+b[i])
for i in c: d.append(n-i)
for i in range(n):
    j=i; l=0; r=0
    for j in range(i,n):
    	if d[i]<d[j]: r+=1
    b1.append(r); j=0
    for j in range(i+1):
    	if d[i]<d[j]: l+=1
    a1.append(l)
for i in range(n):
    if(a[i]!=a1[i] or b[i]!=b1[i]): check+=1
if check==1:
    print("YES")
    for j in range(n): print(d[j], end=' ')
else: print("NO")


require 'set'
n = gets.to_i

class KG

  def initialize(ind,l,r)
    @ind = ind
    @l = l
    @r = r
  end

  attr_accessor :ind
  attr_accessor :l
  attr_accessor :r
  attr_accessor :val
end

ls = gets.chomp.split(" ").map(&:to_i)
rs = gets.chomp.split(" ").map(&:to_i)

students = []
(0..n-1).each do |i|
  students.push KG.new(i,ls[i],rs[i])
end

newstud = []

students.each_with_index do |student,i|

  if student.l>i
    puts "NO"
    exit
  end
  newstud.insert(student.l,student)
end

val = n

newstud.each_with_index do |stud,i|
  students[stud.ind].val = val

  unless ((i!=(n-1)) and stud.l+stud.r == newstud[i+1].l+newstud[i+1].r)
    val-=1
  end
end

#students.each do |stud|
#  puts "#{stud.ind} #{stud.val} #{stud.l} #{stud.r}"
#end

seen = Set.new

students.reverse.each do |stud|
  k = 0
  seen.each do |seenstud|
    k+=1 if seenstud>stud.val
  end

  if k!=stud.r
    puts "NO"
    exit
  end

  seen.add stud.val
end

puts "YES"
students.each do |stud|
  print "#{stud.val} "
end
puts


require 'set'
n = gets.to_i

class KG

  def initialize(ind,l,r)
    @ind = ind
    @l = l
    @r = r
  end

  attr_accessor :ind
  attr_accessor :l
  attr_accessor :r
  attr_accessor :val
end

ls = gets.chomp.split(" ").map(&:to_i)
rs = gets.chomp.split(" ").map(&:to_i)

students = []
(0..n-1).each do |i|
  students.push KG.new(i,ls[i],rs[i])
end

newstud = []

students.each_with_index do |student,i|

  if student.l>i
    puts "NO"
    exit
  end
  newstud.insert(student.l,student)
end

val = n

newstud.each_with_index do |stud,i|
  students[stud.ind].val = val

  unless ((i!=(n-1)) and stud.l+stud.r == newstud[i+1].l+newstud[i+1].r)
    val-=1
  end
end

seen = Array.new

students.reverse.each do |stud|
  k = 0
  seen.each do |seenstud|
    k+=1 if seenstud>stud.val
  end

  if k!=stud.r
    puts "NO"
    exit
  end

  seen.push stud.val
end

puts "YES"
students.each do |stud|
  print "#{stud.val} "
end
puts


R=lambda: map(int,raw_input().split())
n=int(raw_input())
a=R()
b=R()
Co=[n-k-l for k,l in zip(a,b)]
for i in xrange(n):
    p=sum(Co[o]>Co[i] for o in xrange(i) )
    q=sum(Co[o]>Co[i] for o in xrange(i+1,n))
    if p!=a[i] or q!=b[i]:
        print "NO"
        break
else:
        print "YES"
        print ' '.join(str(i) for i in Co)


N = input()
l = map(int, raw_input().split())
r = map(int, raw_input().split())

def sanitycheck(arr):
    for i in range(len(arr)):
        if arr[i] > i:
        #    print 'failed on {} and {}'.format(i,arr[i])
            return False

    return True

ok = sanitycheck(l) and sanitycheck(r[::-1])
if not ok:
    print 'NO'
    exit()

msort = [[] for _ in range(N+1)]
for child in range(N):
    tot = l[child] + r[child]
    msort[tot].append(child)

most = 0
for group in range(N):
    if msort[group]:
        most +=1

if msort[0]:
    candies = [0 for _ in range(N)]
    for groups in range(N):
        for ch in msort[groups]:
            candies[ch]= most
        if msort[groups]:
            most -= 1
    print 'YES'
    s= ' '.join(map(str, candies))
    print s
else:
    print 'NO'
# dblcheckintheend?


N = input()
l = map(int, raw_input().split())
r = map(int, raw_input().split())

def sanitycheck(arr):
    for i in range(len(arr)):
        if arr[i] > i:
        #    print 'failed on {} and {}'.format(i,arr[i])
            return False

    return True

def izOk(candidate):
    for child in range(N):
        lc= 0
        rc = 0
        for left in range(0, child):
            if candidate[left] > candidate[child]:
                lc+= 1
        if lc != l[child]:
        #    print 'lc {} for {} is wrongs'.format(lc, child)
            return False
        for right in range(child+1, N):
            if candidate[right] > candidate[child]:
                rc+= 1
        if rc != r[child]:
        #    print 'rc {} for {} is wrongs'.format(rc, child)

            return False
    return True

ok = sanitycheck(l) and sanitycheck(r[::-1])
if not ok:
    print 'NO'
    exit()

msort = [[] for _ in range(N+1)]
for child in range(N):
    tot = l[child] + r[child]
    msort[tot].append(child)

most = 0
for group in range(N):
    if msort[group]:
        most +=1

if msort[0]:
    candies = [0 for _ in range(N)]
    for groups in range(N):
        for ch in msort[groups]:
            candies[ch]= most
        if msort[groups]:
            most -= 1
    if izOk(candies):
        print 'YES'
        s= ' '.join(map(str, candies))
        print s
    else:
        print 'NO'
else:
    print 'NO'
# dblcheckintheend?


N = input()
l = map(int, raw_input().split())
r = map(int, raw_input().split())

def sanitycheck(arr):
    for i in range(len(arr)):
        if arr[i] > i:
        #    print 'failed on {} and {}'.format(i,arr[i])
            return False

    return True

ok = sanitycheck(l) and sanitycheck(r[::-1])
if not ok:
    print 'NO'
    exit()

msort = [[] for _ in range(N+1)]
for child in range(N):
    tot = l[child] + r[child]
    msort[tot].append(child)

cand = 1
candies = [0 for _ in range(N)]
for fewest in range(N, -1, -1):
    for ch in msort[fewest]:
        candies[ch]= cand
    if msort[fewest]:
        cand += 1
print 'YES'
s= ' '.join(map(str, candies))
print s

# dblcheckintheend?


n = int(raw_input())
l = map(int, raw_input().split())
r = map(int, raw_input().split())
ans = []
flag = True
for i in range(n):
    ans.append(n-l[i]-r[i])
temp = min(ans)-1
ans = [i-temp for i in ans]
for i in range(n):
    temp = 0
    for j in range(i):
        if(ans[j]>ans[i]):
            temp += 1
    if(temp != l[i]):
        flag = False
        print('NO')
        break
    temp = 0
    for j in range(i+1, n):
        if(ans[j]>ans[i]):
            temp += 1
    if(temp != r[i]):
        flag = False
        print('NO')
        break
if(flag):
    print 'YES'
    for i in ans:
        print i,


n = int(input())

L = map(int, raw_input().split())
R = map(int, raw_input().split())

res = []

for x in xrange(n):
    res.append(n-L[x]-R[x])

flag = True

for x in xrange(n):
    if L[x]+R[x]>n-1 or L[x]>x or R[x]>n-1-x:
        print "NO", 1
        flag = False
        break

#print L, R

if flag:
    for x in xrange(n):
        l = r = 0
        for y in xrange(n):
            if res[y]>res[x]:
                if y<x:
                    r += 1
                else:
                    l += 1
        #print x, res, l, r
        if l!=R[x] or r!=L[x]:
            print "NO"

            flag = False
            break
if flag:
    print "YES"
    for x in res:
        print x,

'''
flag = True

Lflag = [False]*n
Rflag = [False]*n

for x in xrange(n):
    if L[x]+R[x]>n-1 or L[x]>x or R[x]>n-1-x:
        print "NO"
        flag = False
        break

    if x!=n-1:
        if L[x]>L[x+1]:
            Lflag[x] = True

    if x!=0:
        if R[x]>R[x-1]:
            Rflag[x] = True

if flag:
    for x in xrange(n):
        if x!=n-1:
            if Lflag[x]==Rflag[x+1] and Lflag[x]:
                print "NO"
                flag = False

print Lflag, L, Rflag, R
if flag:
    res = [1]*n
    tp = True
    while flag:
        flag = False
        for x in xrange(n-1):
            if Lflag[x]:
                if res[x]<=res[x+1]:
                    res[x] = 1+res[x+1]
                    flag = True
                    if res[x]>n:
                        flag = False
                        print "NO"
                        tp = False
                        break

        if not tp:
            break

        for x in xrange(n-1, 0, -1):
            if Rflag[x]:
                if res[x]<=res[x-1]:
                    res[x] = 1+res[x-1]
                    flag = True
                    if res[x]>n:
                        flag = False
                        print "NO"
                        tp = False
                        break

        if tp:
            break

    if tp:
        print "YES"
        for x in res:
            print x,

'''


n = int(input())

L = map(int, raw_input().split())
R = map(int, raw_input().split())

res = []

for x in xrange(n):
    res.append(n-L[x]-R[x])

flag = True

for x in xrange(n):
    if L[x]+R[x]>n-1 or L[x]>x or R[x]>n-1-x:
        print "NO"
        flag = False
        break

#print L, R

if flag:
    for x in xrange(n):
        l = r = 0
        for y in xrange(n):
            if res[y]>res[x]:
                if y<x:
                    r += 1
                else:
                    l += 1
        #print x, res, l, r
        if l!=R[x] or r!=L[x]:
            print "NO"

            flag = False
            break
if flag:
    print "YES"
    for x in res:
        print x,

'''
flag = True

Lflag = [False]*n
Rflag = [False]*n

for x in xrange(n):
    if L[x]+R[x]>n-1 or L[x]>x or R[x]>n-1-x:
        print "NO"
        flag = False
        break

    if x!=n-1:
        if L[x]>L[x+1]:
            Lflag[x] = True

    if x!=0:
        if R[x]>R[x-1]:
            Rflag[x] = True

if flag:
    for x in xrange(n):
        if x!=n-1:
            if Lflag[x]==Rflag[x+1] and Lflag[x]:
                print "NO"
                flag = False

print Lflag, L, Rflag, R
if flag:
    res = [1]*n
    tp = True
    while flag:
        flag = False
        for x in xrange(n-1):
            if Lflag[x]:
                if res[x]<=res[x+1]:
                    res[x] = 1+res[x+1]
                    flag = True
                    if res[x]>n:
                        flag = False
                        print "NO"
                        tp = False
                        break

        if not tp:
            break

        for x in xrange(n-1, 0, -1):
            if Rflag[x]:
                if res[x]<=res[x-1]:
                    res[x] = 1+res[x-1]
                    flag = True
                    if res[x]>n:
                        flag = False
                        print "NO"
                        tp = False
                        break

        if tp:
            break

    if tp:
        print "YES"
        for x in res:
            print x,

'''


n=int(raw_input())
L=map(int, raw_input().split())
R=map(int, raw_input().split())
"""
n=5
L=[0, 0, 1, 1, 2]
R=[2, 0, 1, 0, 0]
"""
for i in range(n):
    if L[i]>i:
        print 'NO'
        exit()
    if R[i]>n-1-i:
        print 'NO'
        exit()

Rank=[[L[i]+R[i]+1,i] for i in range(n)]

Rank.sort()
#print Rank

C=[0]*n

t=1000
x=1

if Rank[0][0]!=1:
    print 0
    exit()
C[Rank[0][1]]=1000

for i in range(1,n):
    #print x
    if Rank[i][0]==Rank[i-1][0]:
        C[Rank[i][1]]=C[Rank[i-1][1]]
        x+=1
    else:
        if Rank[i][0] !=x+1:
            print 'NO'
            exit()
        C[Rank[i][1]]=C[Rank[i-1][1]]-1
        x+=1

print 'YES'
print ' '.join(map(str,C))
exit()


n=int(raw_input())
L=map(int, raw_input().split())
R=map(int, raw_input().split())
"""
n=5
L=[0, 0, 1, 1, 2]
R=[2, 0, 1, 0, 0]
"""
for i in range(n):
    if L[i]>i:
        print 'NO'
        exit()
    if R[i]>n-1-i:
        print 'NO'
        exit()

Rank=[[L[i]+R[i]+1,i] for i in range(n)]

Rank.sort()
#print Rank

C=[0]*n

t=1000
x=1

if Rank[0][0]!=1:
    print 'NO'
    exit()
C[Rank[0][1]]=n

for i in range(1,n):
    #print x
    if Rank[i][0]==Rank[i-1][0]:
        C[Rank[i][1]]=C[Rank[i-1][1]]
        x+=1
    else:
        if Rank[i][0] !=x+1:
            print 'NO'
            exit()
        C[Rank[i][1]]=C[Rank[i-1][1]]-1
        x+=1

print 'YES'
print ' '.join(map(str,C))
exit()


n=int(raw_input())
L=map(int, raw_input().split())
R=map(int, raw_input().split())
"""
n=5
L=[0, 0, 1, 1, 2]
R=[2, 0, 1, 0, 0]
"""
for i in range(n):
    if L[i]>i:
        print 'NO'
        exit()
    if R[i]>n-1-i:
        print 'NO'
        exit()

Rank=[[L[i]+R[i]+1,i] for i in range(n)]

Rank.sort()
#print Rank

C=[0]*n

t=1000
x=1

if Rank[0][0]!=1:
    print 'NO'
    exit()
C[Rank[0][1]]=n

for i in range(1,n):
    #print x
    if Rank[i][0]==Rank[i-1][0]:
        C[Rank[i][1]]=C[Rank[i-1][1]]
        x+=1
    else:
        if Rank[i][0] !=x+1:
            print 'NO'
            exit()
        C[Rank[i][1]]=C[Rank[i-1][1]]-1
        x+=1

Rc=[0]*n
for i in range(n-1):
    ct=0
    for j in range(i+1,n):
        if C[j]>C[i]:
            ct+=1
    Rc[i]=ct

if Rc!=R:
    print 'NO'
    exit()

print 'YES'
print ' '.join(map(str,C))
exit()


import sys
import operator

n = int(sys.stdin.readline())
lvec = map(int, sys.stdin.readline().split())
rvec = map(int, sys.stdin.readline().split())

# check if any is larger than permitted

for i in range(n):
  if lvec[i] > n or rvec[i] > (n - i -1):
    print("NO")
    exit()

rankvec = map(operator.add, lvec, rvec)

candies = map(operator.sub, [max(rankvec) + 1]*n, rankvec)

lvecnew = [0]*n
rvecnew = [0]*n

for i in range(n):
  # count actual left and right
  for j in range(i):
    lvecnew[i] += (candies[j] > candies[i])*1
  for j in range(i + 1, n):
    rvecnew[i] += (candies[j] > candies[i])*1

if lvecnew != lvec or rvecnew != rvec:
  print("NO")
  exit()

print("YES")
print(" ".join(str(x) for x in candies))


import sys
n = int(sys.stdin.readline())
l = map(int,sys.stdin.readline().split(' '))
r = map(int,sys.stdin.readline().split(' '))

result=[0]*n
num=n
flag = 0
flag2 = 1
for j in range(n):
    count = 0
    indices = []
    for i in range(n):
        if l[i] == 0 and r[i] == 0:
            count += 1
            l[i] = '.'
            r[i] = '.'
            indices.append(i)

    if count == 0:
        flag = 1
        break

    for i in indices:
        result[i] = num

    num -= 1

    for index in indices:
        for i in range(n):
            if i < index and r[i] != '.':
                r[i] -= 1

            if i > index and l[i] != '.':
                l[i] -= 1
            if(r[i] < 0 or l[i] < 0):
                flag = 1
                break

        if flag == 1:
            break
    flag2 = 0
    for i in range(n):
        if not (l[i] == '.' and r[i] == '.'):
            flag2 = 1
            break

    if flag2 == 0:
        break
    if flag == 1:
        break

if flag == 1:
    print "NO"

if flag == 0 or flag2 == 0:
    print "YES"
    print ' '.join(map(str,result))


n = input()
l = map(int,raw_input().split())
r = map(int,raw_input().split())
a = [[] for i in range(max(l)+max(r)+1)]
ans = [0 for i in range(n)]
for i in range(n):
    a[l[i]+r[i]].append(i)

x = n
for i in range(len(a)):
    if len(a[i]):
        q = a[i]
        for i in range(len(q)):
            ans[q[i]] = x
        x-=1

u = []
v = []
for i in range(n):
    if ans[i]<1:
        break
    c = 0
    for j in range(0,i):
        if ans[j]>ans[i]:
            c+=1
    u.append(c)

    c = 0
    for j in range(i+1,n):
        if ans[j]>ans[i]:
            c+=1
    v.append(c)

if u==l and v==r:
    print 'YES'
    for i in ans:
        print i,
else:
    print 'NO'


#include <stdio.h>
#include <malloc.h>

int main(void) {
	// your code goes here
	int n;
	scanf("%d",&n);
	int* l;
	int* r;
	int* a;
	l=(int*)malloc(n*sizeof(int));
	r=(int*)malloc(n*sizeof(int));
	int i,j,k;
	int flag=1;
	for(i=0;i<n;i++){
	    scanf("%d",&l[i]);
	    if(l[i]>i) flag=0;
	}
	for(i=0;i<n;i++){
	    scanf("%d",&r[i]);
	    if(r[i]>n-1-i) flag=0;
	}
	if(flag==0){
	    printf("NO\n");
	    return 0;
	}
	a=(int*)malloc(n*sizeof(int));
	for(i=0;i<n;i++){
	    a[i]=n-l[i]-r[i];
	}
	for(i=0;(i<n) && flag;i++){
	    k=0;
	    for(j=0;j<i;j++){
	        if(a[j]>a[i]) k++;
	    }
	    if(k!=l[i]) flag=0;
	    k=0;
	    for(j=i+1;j<n;j++){
	        if(a[j]>a[i]) k++;
	    }
	    if(k!=r[i]) flag=0;
	}
	if(flag==0){
	    printf("NO\n");
	    return 0;
	}
	else{
	    printf("YES\n");
	    for(i=0;i<n;i++){
	        printf("%d ",a[i]);
	    }
	    printf("\n");
	}
	return 0;
}


#include <stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    int l[n],r[n];
    for(int i=0;i<n;i++){
        scanf("%d",&l[i]);
    }
    for(int i=0;i<n;i++){
        scanf("%d",&r[i]);
    }
    int a[n];
    for(int i=0;i<n;i++){
        a[i]=n-l[i]-r[i];
    }
    int flag=1;
    for(int i=0;i<n;i++){
        int temp=a[i];
        int count=0;
        for(int j=i;j>=0;j++){
            if(a[j]>temp)count++;
        }
        if(count!=l[i]){
            flag=0;break;
        }
        for(int j=i;j<n;j++){
            if(a[j]>a[i])count++;
        }
        if(count!=r[i]){
            flag=0;break;
        }
    }
    if(flag==0)printf("NO");
    else{
        printf("YES");
        for(int i=0;i<n;i++){
            printf("%d ",a[i]);
        }
    }
}


#include <stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    int l[n],r[n];
    for(int i=0;i<n;i++){
        scanf("%d",&l[i]);
    }
    for(int i=0;i<n;i++){
        scanf("%d",&r[i]);
    }
    int a[n];
    for(int i=0;i<n;i++){
        a[i]=n-l[i]-r[i];
    }
    int flag=1;
    for(int i=0;i<n;i++){
        int temp=a[i];
        int count=0;
        for(int j=i;j>=0;j--){
            if(a[j]>temp)count++;
        }
        if(count!=l[i]){
            flag=0;break;
        }count=0;
        for(int j=i;j<n;j++){
            if(a[j]>a[i])count++;
        }
        if(count!=r[i]){
            flag=0;break;
        }
    }
    if(flag==0)printf("NO");
    else{
        printf("YES\n");
        for(int i=0;i<n;i++){
            printf("%d ",a[i]);
        }
    }
}


#include <stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    int l[n],r[n];
    for(int i=0;i<n;i++){
        scanf("%d",&l[i]);
    }
    for(int i=0;i<n;i++){
        scanf("%d",&r[i]);
    }
    int a[n];
    for(int i=0;i<n;i++){
        a[i]=n-l[i]-r[i];
    }
    int flag=1;
    for(int i=0;i<n;i++){
        int temp=a[i];
        int count=0;
        for(int j=i;j>=0;j--){
            if(a[j]>temp)count++;
        }
        if(count!=l[i]){
            flag=0;break;
        }
        for(int j=i;j<n;j++){
            if(a[j]>a[i])count++;
        }
        if(count!=r[i]){
            flag=0;break;
        }
    }
    if(flag==0)printf("NO");
    else{
        printf("YES");
        for(int i=0;i<n;i++){
            printf("%d ",a[i]);
        }
    }
}


#include <stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    int l[n],r[n];
    for(int i=0;i<n;i++){
        scanf("%d",&l[i]);
    }
    for(int i=0;i<n;i++){
        scanf("%d",&r[i]);
    }
    int a[n];
    for(int i=0;i<n;i++){
        a[i]=n-l[i]-r[i];
    }
    flag=1;
    for(int i=0;i<n;i++){
        int temp=a[i];
        int count=0;
        for(int j=i;j>=0;j++){
            if(a[j]>temp)count++;
        }
        if(count!=l[i]){
            flag=0;break;
        }
        for(int j=i;j<n;j++){
            if(a[j]>a[i])count++;
        }
        if(count!=r[i]){
            flag=0;break;
        }
    }
    if(flag==0)printf("NO");
    else{
        printf("YES");
        for(int i=0;i<n;i++){
            printf("%d ",a[i]);
        }
    }
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>

typedef long long ll;

int l[1000], r[1000], a[1000];

int main(int argc, char *argv)
{
    int n, i, j, k, v, c=0, cold;
    scanf("%d", &n);
    for (i=0; i<n; i++)
    {
        scanf("%d", &l[i]);
        a[i] = 0;
    }
    for (i=0; i<n; i++)
    {
        scanf("%d", &r[i]);
    }
    v = n;
    while (c < n)
    {
        cold = c;
        for (i=0; i<n; i++)
        {
            if (l[i]+r[i] == cold)
            {
                c++;
                a[i] = v;
            }
        }
        if (cold == c)
        {
            printf("NO\n");
            return 0;
        }
        v --;
    }
    for (i=0; i<n; i++)
    {
        for (j=0; j<i; j++)
        {
            if (a[j] > a[i])
            {
                l[i] --;
            }
        }
        for (k=i+1; k<n; k++)
        {
            if (a[k] > a[i])
            {
                r[i] --;
            }
        }
        if (l[i] < 0 || r[i] < 0)
        {
            printf("NO\n");
            return 0;
        }
    }

    printf("YES\n");
    for (i=0; i<n; i++)
    {
        printf("%d ", a[i]);
    }
    printf("\n");

    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>

typedef long long ll;

int l[1000], r[1000], a[1000];

int main(int argc, char *argv)
{
    int n, i, j, v, c=0, cold;
    scanf("%d", &n);
    for (i=0; i<n; i++)
    {
        scanf("%d", &l[i]);
        a[i] = 0;
    }
    for (i=0; i<n; i++)
    {
        scanf("%d", &r[i]);
    }
    v = n;
    while (c < n)
    {
        cold = c;
        for (i=0; i<n; i++)
        {
            if (l[i]+r[i] == cold)
            {
                c++;
                a[i] = v;
            }
        }
        if (cold == c)
        {
            printf("NO\n");
            return 0;
        }
        v --;
    }
    printf("YES\n");
    for (i=0; i<n; i++)
    {
        printf("%d ", a[i]);
    }
    printf("\n");

    return 0;
}


#include<stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    int l[n],r[n],t[n];
    for(int i=0;i<n;i++)
        scanf("%d",&l[i]);
    for(int i=0;i<n;i++){
        scanf("%d",&r[i]);
        t[i]=n-l[i]-r[i];
        if(t[i]<1){goto fail;}
    }
    for(int i=0;i<n;i++){
        int a=0,b=0;
        for(int j=0;j<i;j++)
            if(t[j]>t[i])a++;
        for(int j=i+1;j<n;j++)
            if(t[j]>t[i])b++;
        if((a!=l[i])||(b!=r[i])){goto fail;}
    }
    printf("YES\n");
    for(int i=0;i<n;i++)
        printf("%d ",t[i]);
    return 0;
    fail: printf("NO");
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void){

  int n;
  int i;

  scanf("%d", &n);

  int l[n], r[n];
  int a[n];

  for(i = 0; i < n; i++){
    scanf("%d", &l[i]);
  }

  for(i = 0; i < n; i++){
    scanf("%d", &r[i]);
  }

  if(l[0] != 0 || r[n - 1] != 0){
    printf("NO\n");
  }else{
    for(i = 0; i < n; i++){
      a[i] = n - (l[i] + r[i]);
    }
    printf("YES\n");
    for(i = 0; i < n; i++){
      printf("%d ", a[i]);
    }
    printf("\n");
  }

  return 0;
}


#include <stdio.h>
int main(void)
{
	int n;
	scanf("%d",&n);
	int l[n];
	int r[n];
	int ans[n];
	int check[n];
	for (int i = 0; i < n; ++i)
	{
		scanf("%d",&l[i]);
		check[i]=1;
		ans[i]=0;
	}
	for (int i = 0; i < n; ++i)
	{
		scanf("%d",&r[i]);

	}
	int alot=n;
	while(alot)
	{
		int c=0;
		for (int i = 0; i < n; ++i)
		{

			if(check[i]==1&&l[i]==0&&r[i]==0)
			{
				check[i]=0;
				ans[i]=alot;
				c++;
			}
		}
		int b=c;
		int a=0;
		for (int i = 0; i < n; ++i)
		{

			if(check[i]==1)
			{
				l[i]-=a;
				r[i]-=b;
			}
			if(check[i]==0)
			{
				b--;
				a++;
			}
		}
		for (int i = 0; i < n; ++i)
		{

			if(check[i]==0)
			{
				check[i]=-1;
			}
		}

		alot--;

	}
	int mark=0;
	for (int i = 0; i < n; ++i)
	{
		if(ans[i]<=0)
		{
			mark=1;
		}
	}
	if(mark==1)
	{
		printf("NO\n");
	}
	else
	{

		printf("YES\n");

		for (int i = 0; i < n; ++i)
		{
			printf("%d ",ans[i] );
		}
	}

}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            TextReader sr = Console.In;
            //StreamReader sr = new StreamReader("in3.txt");
            int n = Convert.ToInt32(sr.ReadLine());
            string[] sll = sr.ReadLine().Split();
            string[] srr = sr.ReadLine().Split();
            int[] l = new int[n];
            int[] r = new int[n];
            //int[] s = new int[n];
            int[] res = new int[n];
            SortedDictionary<int, SortedSet<int>> kol_bol = new SortedDictionary<int, SortedSet<int>>();
            int sum_lr = 0;
            for (int i = 0; i < n; i++)
            {
                l[i] = Convert.ToInt32(sll[i]);
                r[i] = Convert.ToInt32(srr[i]);
                sum_lr = l[i] + r[i];
                if (!kol_bol.ContainsKey(sum_lr)) kol_bol.Add(sum_lr, new SortedSet<int>());
                kol_bol[sum_lr].Add(i);
                //s[i] = l[i] + r[i];
                //if (!kol_bol.ContainsKey(s[i])) kol_bol.Add(s[i], new SortedSet<int>());
                //kol_bol[s[i]].Add(i);
            }
            int max = kol_bol.Count;
            foreach (int k in kol_bol.Keys)
            {
                foreach(int i in kol_bol[k])
                {
                    res[i] = max - k;
                }
            }
            bool can = true;
            int count;
            for (int i = 0; i < n; i++)//проверяемый ребенок
            {
                count = 0;
                for (int j = 0; j < i; j++)//кол-во детей слева с большим кол-вом конфет
                {
                    if (res[j] > res[i]) count++;
                }
                if (count != l[i])
                {
                    can = false;
                    break;
                }
            }
            if (can)
            {
                for (int i = 0; i < n; i++)//проверяемый ребенок
                {
                    count = 0;
                    for (int j = i + 1; j < n; j++)//кол-во детей слева с большим кол-вом конфет
                    {
                        if (res[j] > res[i]) count++;
                    }
                    if (count != r[i])
                    {
                        can = false;
                        break;
                    }
                }
            }
            if (can)
            {
                Console.WriteLine("YES");
                Console.WriteLine(string.Join(" ", res));
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            TextReader sr = Console.In;
            //StreamReader sr = new StreamReader("in106.txt");
            int n = Convert.ToInt32(sr.ReadLine());
            string[] sll = sr.ReadLine().Split();
            string[] srr = sr.ReadLine().Split();
            int[] l = new int[n];
            int[] r = new int[n];
            //int[] s = new int[n];
            int[] res = new int[n];
            SortedDictionary<int, SortedSet<int>> kol_bol = new SortedDictionary<int, SortedSet<int>>();
            int sum_lr = 0;
            for (int i = 0; i < n; i++)
            {
                l[i] = Convert.ToInt32(sll[i]);
                r[i] = Convert.ToInt32(srr[i]);
                sum_lr = l[i] + r[i];
                if (!kol_bol.ContainsKey(sum_lr)) kol_bol.Add(sum_lr, new SortedSet<int>());
                kol_bol[sum_lr].Add(i);
                //s[i] = l[i] + r[i];
                //if (!kol_bol.ContainsKey(s[i])) kol_bol.Add(s[i], new SortedSet<int>());
                //kol_bol[s[i]].Add(i);
            }
            //int max = kol_bol.Count;
            bool can = true;
            foreach (int k in kol_bol.Keys)
            {
                foreach(int i in kol_bol[k])
                {
                    //res[i] = max - k;
                    res[i] = n - k;
                }
            }
            int count;
            for (int i = 0; i < n; i++)//проверяемый ребенок
            {
                count = 0;
                for (int j = 0; j < i; j++)//кол-во детей слева с большим кол-вом конфет
                {
                    if (res[j] > res[i]) count++;
                }
                if (count != l[i])
                {
                    can = false;
                    break;
                }
            }
            if (can)
            {
                for (int i = 0; i < n; i++)//проверяемый ребенок
                {
                    count = 0;
                    for (int j = i + 1; j < n; j++)//кол-во детей слева с большим кол-вом конфет
                    {
                        if (res[j] > res[i]) count++;
                    }
                    if (count != r[i])
                    {
                        can = false;
                        break;
                    }
                }
            }
            if (can)
            {
                Console.WriteLine("YES");
                Console.WriteLine(string.Join(" ", res));
            }
            else
            {
                Console.WriteLine("NO");
            }

        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace contest
{
    class Program
    {
#if DEBUG
        static readonly TextReader input = File.OpenText(@"../../A/A.in");
        static readonly TextWriter output = File.CreateText(@"../../A/A.out");
#else
        static readonly TextReader input = Console.In;
        static readonly TextWriter output = Console.Out;
#endif
        private static void SolveD()
        {
            int[] inp = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
            long n = inp[0], k = inp[1];
            int[] all = input.ReadLine().Split(' ').Select(int.Parse).ToArray();

            Dictionary<int, int> sums = new Dictionary<int, int>();
            int mult = 0;
            int max = (1 << (int)k) - 1;

            int zeros = 1;
            int ones = 0;

            for (int i = 0; i < n; ++i)
            {
                int me = mult ^ all[i];
                zeros += sums.ContainsKey(me) ? sums[me] : 0;
                int rev = max - me;
                ones += sums.ContainsKey(rev) ? sums[rev] : 0;

                if (sums.ContainsKey(mult))
                {
                    sums[mult] += 1;
                }
                else sums[mult] = 1;
                mult = me;
            }

            long res = n * (n - 1) / 2 + n;
            res -= Math.Min(ones, zeros);
            output.WriteLine(res);
        }

        private static void SolveC()
        {
            int n = int.Parse(input.ReadLine());
            int[] l = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int[] r = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int[] sum = new int[n];
            int mmin = int.MaxValue;
            HashSet<int> all = new HashSet<int>();
            for(int i = 0; i < n; ++i)
            {
                sum[i] = l[i] + r[i];
                all.Add(sum[i]);
                if (sum[i] < mmin) mmin = sum[i];
            }

            int[] ordered = all.ToArray();
            Array.Sort(ordered);
            Dictionary<int, int> order = new Dictionary<int, int>();
            for(int i = 0; i < ordered.Length; ++i)
            {
                order[ordered[i]] = i;
            }

            int[] res = new int[n];
            for (int i = 0; i < n; ++i)
            {
                res[i] = n - order[sum[i]];
            }

            for (int i = 0; i < n; ++i)
            {
                int left = 0, right = 0;
                for (int j = 0; j < i; ++j)
                {
                    if (res[j] > res[i]) left++;
                }
                for (int j = i+1; j < n; ++j)
                {
                    if (res[j] > res[i]) right++;
                }

                if (left != l[i] || right != r[i])
                {
                    output.WriteLine("NO");
                    return;
                }
            }

            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < n; ++i) sb.Append(res[i] + ((i == n - 1) ? "" : " "));
            output.WriteLine("YES");
            output.WriteLine(sb);
        }

        private static void SolveB()
        {
            int n = int.Parse(input.ReadLine());
            int[] l = input.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int prev = -1;
            for (int i = 0; i < n; ++i)
            {
                if (l[i] <= prev)
                {
                    continue;
                }

                if (l[i] == (prev + 1))
                {
                    prev++;
                    continue;
                }

                output.WriteLine(i + 1);
                return;
            }

            output.WriteLine(-1);
        }

        private static void SolveA()
        {
            int[] l = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int x = l[0], y = l[1], z = l[2], t1 = l[3], t2 = l[4], t3 = l[5];

            int lift = Math.Abs(z - x) * t2 + 3*t3 + Math.Abs(x - y) * t2;
            int foot = Math.Abs(x - y) * t1;
            if(lift <= foot) output.WriteLine("YES");
            else output.WriteLine("NO");
        }

        static void Main(string[] args)
        {
            SolveC();
            //SolveD();
            output.Flush();
        }
    }
}


using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		string[] str = Console.ReadLine().Split();
		string[] str2 = Console.ReadLine().Split();
		int[] L = new int[N];
		int[] R = new int[N];
		int[] A = new int[N];
		bool flag1 = false;
		bool flag2 = true;
		for(var i=0;i<N;i++){
			L[i] = int.Parse(str[i]);
			R[i] = int.Parse(str2[i]);
			if(L[i] == 0 && R[i] == 0){
				flag1 = true;
			}
			if(L[i] > i || R[i] > N-1-i){
				flag2 = false;
				break;
			}
			if(L[i] + R[i] >= N){
				flag2 = false;
				break;
			}
		}
		string ans = "NO";
		if(flag1 == true && flag2 == true){
			ans = "YES";
		}
		if(ans == "YES"){
			for(var i=0;i<N;i++){
				A[i] = N-L[i]-R[i];
			}
			for(var i=0;i<N;i++){
				int ctL = 0;
				int ctR = 0;
				for(var j=0;j<i;j++){
					if(A[j] > A[i]){
						ctL += 1;
					}
				}
				if(ctL != L[i]){
					ans = "NO";
					break;
				}
				for(var j=i+1;j<N;j++){
					if(A[j] > A[i]){
						ctR += 1;
					}
				}
				if(ctR != R[i]){
					ans = "NO";
					break;
				}
			}
		}
		Console.WriteLine(ans);
		if(ans == "YES"){
			Console.Write(A[0]);
			for(var i=1;i<N;i++){
				Console.Write(" "+A[i]);
			}
		}
	}
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Candies_Distribution
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            Solve(args);
            writer.Flush();
        }

        private static void Solve(string[] args)
        {
            int n = Next();

            var l = new int[n];
            for (int i = 0; i < n; i++)
            {
                l[i] = Next();
            }

            var r = new int[n];
            for (int i = 0; i < n; i++)
            {
                r[i] = Next();
            }

            LinkedList<Node> ll = Process(n, l, true);
            if (ll == null)
                return;
            LinkedList<Node> rl = Process(n, r, false);
            if (rl == null)
                return;

            var ans = new int[n];
            int cnt = n;

            while (true)
            {
                LinkedListNode<Node> ln = ll.Last;
                LinkedListNode<Node> rn = rl.Last;
                if (ln == null || rn == null)
                    break;

                LinkedListNode<Node> node = ln;
                var l1 = new List<LinkedListNode<Node>>();
                while (node != null)
                {
                    l1.Add(node);
                    if (node.Value.big)
                        break;
                    node = node.Previous;
                }
                node = rn;
                var l2 = new List<LinkedListNode<Node>>();
                while (node != null)
                {
                    l2.Add(node);
                    if (node.Value.big)
                        break;
                    node = node.Previous;
                }
                int min = Math.Min(l1.Count, l2.Count);
                l1.Sort(0, min, ln.Value);
                l2.Sort(0, min, ln.Value);

                for (int i = 0; i < min; i++)
                {
                    if (l1[i].Value.index != l2[i].Value.index)
                    {
                        writer.WriteLine("NO");
                        return;
                    }
                    ans[l1[i].Value.index] = cnt;
                    ll.Remove(l1[i]);
                    rl.Remove(l2[i]);
                }
                cnt--;
            }
            writer.WriteLine("YES");
            foreach (int an in ans)
            {
                writer.Write(an);
                writer.Write(' ');
            }
            writer.WriteLine();
        }

        private static LinkedList<Node> Process(int n, int[] l, bool f)
        {
            var list = new LinkedList<Node>();
            for (int i = f ? 0 : n - 1;; i += f ? 1 : -1)
            {
                if (f && i == n)
                    break;
                if (!f && i == -1)
                    break;
                if (l[i] > list.Count)
                {
                    writer.WriteLine("NO");
                    return null;
                }
                if (l[i] == 0)
                {
                    list.AddLast(new Node {index = i});
                }
                else
                {
                    LinkedListNode<Node> node = list.Last;
                    for (int j = 1; j < l[i]; j++)
                    {
                        node = node.Previous;
                    }
                    list.AddBefore(node, new Node {index = i});
                    node.Value.big = true;
                }
            }
            return list;
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }

        #region Nested type: Node

        private class Node : IComparer<LinkedListNode<Node>>
        {
            public bool big;
            public int index;

            #region IComparer<LinkedListNode<Node>> Members

            public int Compare(LinkedListNode<Node> x, LinkedListNode<Node> y)
            {
                return x.Value.index.CompareTo(y.Value.index);
            }

            #endregion
        }

        #endregion
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Candies_Distribution
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            Solve(args);
            writer.Flush();
        }

        private static void Solve(string[] args)
        {
            int n = Next();

            var l = new int[n];
            for (int i = 0; i < n; i++)
            {
                l[i] = Next();
            }

            var r = new int[n];
            for (int i = 0; i < n; i++)
            {
                r[i] = Next();
            }

            LinkedList<Node> ll = Process(n, l, true);
            if (ll == null)
                return;
            LinkedList<Node> rl = Process(n, r, false);
            if (rl == null)
                return;

            var ans = new int[n];
            int cnt = n;

            while (true)
            {
                LinkedListNode<Node> ln = ll.Last;
                LinkedListNode<Node> rn = rl.Last;
                if (ln == null || rn == null)
                    break;

                if (ln.Value.big)
                {
                    LinkedListNode<Node> node = rn;
                    while (node != null && node.Value.index != ln.Value.index && !node.Value.big)
                    {
                        node = node.Previous;
                    }
                    if (node == null || node.Value.index != ln.Value.index)
                    {
                        writer.WriteLine("NO");
                        return;
                    }
                    ans[ln.Value.index] = cnt--;
                    ll.Remove(ln);
                    rl.Remove(node);
                }
                else if (rn.Value.big)
                {
                    LinkedListNode<Node> node = ln;
                    while (node != null && node.Value.index != rn.Value.index && !node.Value.big)
                    {
                        node = node.Previous;
                    }
                    if (node == null || node.Value.index != rn.Value.index)
                    {
                        writer.WriteLine("NO");
                        return;
                    }
                    ans[rn.Value.index] = cnt--;
                    rl.Remove(rn);
                    ll.Remove(node);
                }
                else
                {
                    LinkedListNode<Node> node = ln;
                    var l1 = new List<LinkedListNode<Node>>();
                    while (node != null)
                    {
                        l1.Add(node);
                        if (node.Value.big)
                            break;
                        node = node.Previous;
                    }
                    node = rn;
                    var l2 = new List<LinkedListNode<Node>>();
                    while (node != null)
                    {
                        l2.Add(node);
                        if (node.Value.big)
                            break;
                        node = node.Previous;
                    }
                    int min = Math.Min(l1.Count, l2.Count);
                    l1.Sort(0, min, ln.Value);
                    l2.Sort(0, min, ln.Value);

                    for (int i = 0; i < min; i++)
                    {
                        if (l1[i].Value.index != l2[i].Value.index)
                        {
                            writer.WriteLine("NO");
                            return;
                        }
                        ans[l1[i].Value.index] = cnt;
                        ll.Remove(l1[i]);
                        rl.Remove(l2[i]);
                    }
                    cnt--;
                }
            }
            writer.WriteLine("YES");
            foreach (int an in ans)
            {
                writer.Write(an);
                writer.Write(' ');
            }
            writer.WriteLine();
        }

        private static LinkedList<Node> Process(int n, int[] l, bool f)
        {
            var list = new LinkedList<Node>();
            for (int i = f ? 0 : n - 1;; i += f ? 1 : -1)
            {
                if (f && i == n)
                    break;
                if (!f && i == -1)
                    break;
                if (l[i] > list.Count)
                {
                    writer.WriteLine("NO");
                    return null;
                }
                if (l[i] == 0)
                {
                    list.AddLast(new Node {index = i});
                }
                else
                {
                    LinkedListNode<Node> node = list.Last;
                    for (int j = 1; j < l[i]; j++)
                    {
                        node = node.Previous;
                    }
                    list.AddBefore(node, new Node {index = i});
                    node.Value.big = true;
                }
            }
            return list;
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }

        #region Nested type: Node

        private class Node : IComparer<LinkedListNode<Node>>
        {
            public bool big;
            public int index;

            #region IComparer<LinkedListNode<Node>> Members

            public int Compare(LinkedListNode<Node> x, LinkedListNode<Node> y)
            {
                return x.Value.index.CompareTo(y.Value.index);
            }

            #endregion
        }

        #endregion
    }
}


using System;
using System.Collections.Generic;

namespace Program {
    class Program {
        static int N;
        static int[] l, r, slv;
        static void Main(string[] args) {
            N = ri();
            l = ris();
            r = ris();
            slv = new int[N];
            for (int i = 0; i < N; i++) {
                slv[i] = N - (l[i] + r[i]);
                if (slv[i] <= 0) {
                    Console.WriteLine("NO");
                    return;
                }
            }
            if (Check()) {
                Console.WriteLine("YES");
                Console.WriteLine(string.Join(" ", slv));
            } else {
                Console.WriteLine("NO");
            }
        }

        static bool Check() {
            for (int i = 0; i < N; i++) {
                if (Check(slv[i], 0, i) != l[i] || Check(slv[i], i + 1, N) != r[i])
                    return false;
            }
            return true;
        }

        static int Check(int num, int from, int to) {
            var res = 0;
            for (int i = from; i < to; i++) {
                if (slv[i] > num)
                    res++;
            }
            return res;
        }

        static int[] ris() {
            return Array.ConvertAll(Console.ReadLine().Split(' '), i => Int32.Parse(i));
        }

        static int ri() {
            var i = Console.ReadLine();
            return Int32.Parse(i);
        }
        static (int, int) r2i() {
            var i = Console.ReadLine().Split(' ');
            return (Int32.Parse(i[0]), Int32.Parse(i[1]));
        }
        static (int, int, int) r3i() {
            var i = Console.ReadLine().Split(' ');
            return (Int32.Parse(i[0]), Int32.Parse(i[1]), Int32.Parse(i[2]));
        }
    }
}


using System;
using System.Collections.Generic;

namespace Program {
    class Program {
        static int N;
        static int[] l, r, slv;
        static void Main(string[] args) {
            N = ri();
            l = ris();
            r = ris();
            slv = new int[N];
            for (int i = 0; i < N; i++) {
                slv[i] = N - (l[i] + r[i]);
                if (slv[i] <= 0 >) {
                    Console.WriteLine("NO");
                    return;
                }
            }
            if (Check()) {
                Console.WriteLine("YES");
                Console.WriteLine(string.Join(" ", slv));
            } else {
                Console.WriteLine("NO");
            }

        }

        static bool Check() {
            for (int i = 0; i < N; i++) {
                if (Check(slv[i], 0, i) != l[i] || Check(slv[i], i + 1, N) != r[i])
                    return false;
            }
            return true;
        }

        static int Check(int num, int from, int to) {
            var res = 0;
            for (int i = from; i < to; i++) {
                if (slv[i] > num)
                    res++;
            }
            return res;
        }

        static int[] ris() {
            return Array.ConvertAll(Console.ReadLine().Split(' '), i => Int32.Parse(i));
        }

        static int ri() {
            var i = Console.ReadLine();
            return Int32.Parse(i);
        }
        static (int, int) r2i() {
            var i = Console.ReadLine().Split(' ');
            return (Int32.Parse(i[0]), Int32.Parse(i[1]));
        }
        static (int, int, int) r3i() {
            var i = Console.ReadLine().Split(' ');
            return (Int32.Parse(i[0]), Int32.Parse(i[1]), Int32.Parse(i[2]));
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace C
{
	class Program
	{
		static void Main(string[] args)
		{
			int n = Int32.Parse(Console.ReadLine());
			int[] l = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int[] r = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int[] a = new int[n];
			int k = n;
			while (k > 0)
			{
				bool b = false;
				int c = 0;
				int[] m = new int[n+1];
				for (int i = 0; i < n; i++)
				{
					if ((l[i] < 0) || (r[i] < 0))
					{
						Console.WriteLine("NO");
						return;
					}
					if ((l[i] == 0) && (r[i] == 0))
					{
						l[i] = Int32.MaxValue;
						r[i] = Int32.MaxValue;
						a[i] = k;
						m[c] = i;
						c++;
						b = true;
					}
				}
				if (!b)
				{
					Console.WriteLine("NO");
					return;
				}
				k = k - c;
				int e = 0;
				while (m[e] > 0)
				{
					for (int j = 0; j < m[e]; j++)
					{
						r[j]--;
					}
					for (int j = m[e] + 1; j < n; j++)
					{
						if (l[j] != 0) l[j]--;
					}
					e++;
				}

				//Console.WriteLine();
				//for (int i = 0; i < n - 1; i++)
				//{
				//	Console.Write(l[i] + " ");
				//}
				//Console.WriteLine(l[n - 1]);
				//for (int i = 0; i < n - 1; i++)
				//{
				//	Console.Write(r[i] + " ");
				//}
				//Console.WriteLine(r[n - 1]);
			}

			Console.WriteLine("YES");
			for (int i = 0; i < n-1; i++)
			{
				Console.Write(a[i] + " ");
			}
			Console.WriteLine(a[n-1]);
		}
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace C
{
	class Program
	{
		static void Main(string[] args)
		{
			int n = Int32.Parse(Console.ReadLine());
			int[] l = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int[] r = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int[] a = new int[n];
			int k = n;
			while (k > 0)
			{
				bool b = false;
				int c = 0;
				int[] m = new int[n+1];
				for (int i = 0; i <= n; i++) m[i] = -1;
				for (int i = 0; i < n; i++)
				{
					if ((l[i] < 0) || (r[i] < 0))
					{
						Console.WriteLine("NO");
						return;
					}
					if ((l[i] == 0) && (r[i] == 0))
					{
						l[i] = Int32.MaxValue;
						r[i] = Int32.MaxValue;
						a[i] = k;
						m[c] = i;
						c++;
						b = true;
					}
				}
				if (!b)
				{
					Console.WriteLine("NO");
					return;
				}
				k = k - c;
				int e = 0;
				while (m[e] > -1)
				{
					//Console.WriteLine(m[e]);
					for (int j = 0; j < m[e]; j++)
					{
						r[j]--;
					}
					for (int j = m[e] + 1; j < n; j++)
					{
						//Console.WriteLine(j + ") " + m.Contains(j));
						if (!m.Contains(j)) { l[j]--; }
					}
					e++;
				}

				//Console.WriteLine();
				//for (int i = 0; i < n - 1; i++)
				//{
				//	Console.Write(l[i] + " ");
				//}
				//Console.WriteLine(l[n - 1]);
				//for (int i = 0; i < n - 1; i++)
				//{
				//	Console.Write(r[i] + " ");
				//}
				//Console.WriteLine(r[n - 1]);
			}

			Console.WriteLine("YES");
			for (int i = 0; i < n-1; i++)
			{
				Console.Write(a[i] + " ");
			}
			Console.WriteLine(a[n-1]);
		}
	}
}


#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

#if DEBUG
using System.Diagnostics;
#endif

namespace mr1c
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;
        const string _delim = "!";

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
            var testNumber = 0;
            var timer = new Stopwatch();
            foreach (var test in GetTests())
            {

                timer.Start();

                var defaultColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} -->");
                Console.ForegroundColor = defaultColor;
                Console.SetIn(test);

#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                Solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }

#if DEBUG
                timer.Stop();

                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} FINISHED IN {timer.Elapsed.ToString(@"ss\:fff")}-->");
                Console.ForegroundColor = defaultColor;

                timer.Reset();
                testNumber++;
            }
#endif
        }

        static void Solution()
        {
            #region SOLUTION
            var n = ReadInt();
            var l = ReadIntArray();
            var r = ReadIntArray();
            //if (l[0] != 0 || r[n - 1] != 0)
            //{
            //    Console.WriteLine("NO");
            //    return;
            //}

            var di = new Dictionary<int, List<int>>();
            for (int i = 0; i < n; i++)
            {
                var sum = l[i] + r[i];

                if (l[i] > i)
                {
                    Console.WriteLine("NO");
                    return;
                }

                if (r[i] > n - (i + 1))
                {
                    Console.WriteLine("NO");
                    return;
                }

                if (!di.ContainsKey(sum))
                {
                    di[sum] = new List<int>();
                }

                di[sum].Add(i);
            }

            var ks = di.Keys.ToArray();
            Array.Sort(ks);
            var a = 1;
            var rem = n;
            var res = new int[n];
            for (int i = ks.Length - 1; i >= 0; i--)
            {
                var val = ks[i];
                var v = di[val];
                var count = v.Count;

                if (count > rem)
                {
                    Console.WriteLine("NO");
                    return;
                }

                var wrem = rem - count;
                if (val != wrem)
                {
                    Console.WriteLine("NO");
                    return;
                }

                foreach (var item in v)
                {
                    res[item] = a;
                }

                a++;
                rem -= count;
            }

            for (int i = 0; i < n; i++)
            {
                var cv = res[i];
                var ls = 0;
                for (int j = 0; j < i; j++)
                {
                    ls += res[j] > cv ? 1 : 0;
                }
                var rs = 0;
                for (int j = i + 1; j < n - 1; j++)
                {
                    rs += res[j] > cv ? 1 : 0;
                }

                if (ls != l[i] || rs != r[i])
                {
                    Console.WriteLine("NO");
                    return;
                }
            }

            Console.WriteLine("YES");
            Console.WriteLine(string.Join(" ", res));
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] ReadIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] ReadLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
        static IEnumerable<TextReader> GetTests()
        {
            var tests = new List<string>();
            var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
            using (var resource = new StreamReader(Assembly.GetCallingAssembly().GetManifestResourceStream(resName)))
            {
                while (true)
                {
                    var nextText = new StringBuilder();
                    var endOfFile = false;
                    while (true)
                    {
                        var line = resource.ReadLine();

                        endOfFile = line == null;
                        if (endOfFile)
                        {
                            break;
                        }

                        if (line.Equals(_delim, StringComparison.Ordinal))
                        {
                            break;
                        }

                        nextText.AppendLine(line);
                    }

                    yield return new StringReader(nextText.ToString());

                    if (endOfFile)
                    {
                        break;
                    }
                }
            }
        }
#endif
    }
}


#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

#if DEBUG
using System.Diagnostics;
#endif

namespace mr1c
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;
        const string _delim = "!";

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
            var testNumber = 0;
            var timer = new Stopwatch();
            foreach (var test in GetTests())
            {

                timer.Start();

                var defaultColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} -->");
                Console.ForegroundColor = defaultColor;
                Console.SetIn(test);

#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                Solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }

#if DEBUG
                timer.Stop();

                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} FINISHED IN {timer.Elapsed.ToString(@"ss\:fff")}-->");
                Console.ForegroundColor = defaultColor;

                timer.Reset();
                testNumber++;
            }
#endif
        }

        static void Solution()
        {
            #region SOLUTION
            var n = ReadInt();
            var l = ReadIntArray();
            var r = ReadIntArray();
            //if (l[0] != 0 || r[n - 1] != 0)
            //{
            //    Console.WriteLine("NO");
            //    return;
            //}

            var di = new Dictionary<int, List<int>>();
            for (int i = 0; i < n; i++)
            {
                var sum = l[i] + r[i];

                if (l[i] > i)
                {
                    Console.WriteLine("NO");
                    return;
                }

                if (r[i] > n - (i + 1))
                {
                    Console.WriteLine("NO");
                    return;
                }

                if (!di.ContainsKey(sum))
                {
                    di[sum] = new List<int>();
                }

                di[sum].Add(i);
            }

            var ks = di.Keys.ToArray();
            Array.Sort(ks);
            var a = 1;
            var rem = n;
            var res = new int[n];
            for (int i = ks.Length - 1; i >= 0; i--)
            {
                var val = ks[i];
                var v = di[val];
                var count = v.Count;

                if (count > rem)
                {
                    Console.WriteLine("NO");
                    return;
                }

                var wrem = rem - count;
                if (val != wrem)
                {
                    Console.WriteLine("NO");
                    return;
                }

                foreach (var item in v)
                {
                    res[item] = a;
                }

                a++;
                rem -= count;
            }

            for (int i = 0; i < n; i++)
            {
                var cv = res[i];
                var ls = 0;
                for (int j = 0; j < i; j++)
                {
                    ls += res[j] > cv ? 1 : 0;
                }
                var rs = 0;
                for (int j = i + 1; j < n; j++)
                {
                    rs += res[j] > cv ? 1 : 0;
                }

                if (ls != l[i] || rs != r[i])
                {
                    Console.WriteLine("NO");
                    return;
                }
            }

            Console.WriteLine("YES");
            Console.WriteLine(string.Join(" ", res));
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] ReadIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] ReadLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
        static IEnumerable<TextReader> GetTests()
        {
            var tests = new List<string>();
            var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
            using (var resource = new StreamReader(Assembly.GetCallingAssembly().GetManifestResourceStream(resName)))
            {
                while (true)
                {
                    var nextText = new StringBuilder();
                    var endOfFile = false;
                    while (true)
                    {
                        var line = resource.ReadLine();

                        endOfFile = line == null;
                        if (endOfFile)
                        {
                            break;
                        }

                        if (line.Equals(_delim, StringComparison.Ordinal))
                        {
                            break;
                        }

                        nextText.AppendLine(line);
                    }

                    yield return new StringReader(nextText.ToString());

                    if (endOfFile)
                    {
                        break;
                    }
                }
            }
        }
#endif
    }
}


#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

#if DEBUG
using System.Diagnostics;
#endif

namespace mr1c
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;
        const string _delim = "!";

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
            var testNumber = 0;
            var timer = new Stopwatch();
            foreach (var test in GetTests())
            {

                timer.Start();

                var defaultColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} -->");
                Console.ForegroundColor = defaultColor;
                Console.SetIn(test);

#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                Solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }

#if DEBUG
                timer.Stop();

                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} FINISHED IN {timer.Elapsed.ToString(@"ss\:fff")}-->");
                Console.ForegroundColor = defaultColor;

                timer.Reset();
                testNumber++;
            }
#endif
        }

        static void Solution()
        {
            #region SOLUTION
            var n = ReadInt();
            var l = ReadIntArray();
            var r = ReadIntArray();
            //if (l[0] != 0 || r[n - 1] != 0)
            //{
            //    Console.WriteLine("NO");
            //    return;
            //}

            var di = new Dictionary<int, List<int>>();
            for (int i = 0; i < n; i++)
            {
                var sum = l[i] + r[i];

                if (!di.ContainsKey(sum))
                {
                    di[sum] = new List<int>();
                }

                di[sum].Add(i);
            }

            var ks = di.Keys.ToArray();
            Array.Sort(ks);
            var a = 1;
            var rem = n;
            var res = new int[n];
            for (int i = ks.Length - 1; i >= 0; i--)
            {
                var val = ks[i];
                var v = di[val];
                var count = v.Count;

                var wrem = rem - count;
                if (val != wrem)
                {
                    Console.WriteLine("NO");
                    return;
                }

                foreach (var item in v)
                {
                    res[item] = a;
                }

                a++;
                rem -= count;
            }

            Console.WriteLine("YES");
            Console.WriteLine(string.Join(" ", res));
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] ReadIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] ReadLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
        static IEnumerable<TextReader> GetTests()
        {
            var tests = new List<string>();
            var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
            using (var resource = new StreamReader(Assembly.GetCallingAssembly().GetManifestResourceStream(resName)))
            {
                while (true)
                {
                    var nextText = new StringBuilder();
                    var endOfFile = false;
                    while (true)
                    {
                        var line = resource.ReadLine();

                        endOfFile = line == null;
                        if (endOfFile)
                        {
                            break;
                        }

                        if (line.Equals(_delim, StringComparison.Ordinal))
                        {
                            break;
                        }

                        nextText.AppendLine(line);
                    }

                    yield return new StringReader(nextText.ToString());

                    if (endOfFile)
                    {
                        break;
                    }
                }
            }
        }
#endif
    }
}


#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

#if DEBUG
using System.Diagnostics;
#endif

namespace mr1c
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;
        const string _delim = "!";

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
            var testNumber = 0;
            var timer = new Stopwatch();
            foreach (var test in GetTests())
            {

                timer.Start();

                var defaultColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} -->");
                Console.ForegroundColor = defaultColor;
                Console.SetIn(test);

#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                Solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }

#if DEBUG
                timer.Stop();

                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} FINISHED IN {timer.Elapsed.ToString(@"ss\:fff")}-->");
                Console.ForegroundColor = defaultColor;

                timer.Reset();
                testNumber++;
            }
#endif
        }

        static void Solution()
        {
            #region SOLUTION
            var n = ReadInt();
            var l = ReadIntArray();
            var r = ReadIntArray();
            //if (l[0] != 0 || r[n - 1] != 0)
            //{
            //    Console.WriteLine("NO");
            //    return;
            //}

            var di = new Dictionary<int, List<int>>();
            for (int i = 0; i < n; i++)
            {
                var sum = l[i] + r[i];

                if (l[i] > i)
                {
                    Console.WriteLine("NO");
                    return;
                }

                if (r[i] > n - (i + 1))
                {
                    Console.WriteLine("NO");
                    return;
                }

                if (!di.ContainsKey(sum))
                {
                    di[sum] = new List<int>();
                }

                di[sum].Add(i);
            }

            var ks = di.Keys.ToArray();
            Array.Sort(ks);
            var a = 1;
            var rem = n;
            var res = new int[n];
            for (int i = ks.Length - 1; i >= 0; i--)
            {
                var val = ks[i];
                var v = di[val];
                var count = v.Count;

                if (count > rem)
                {
                    Console.WriteLine("NO");
                    return;
                }

                var wrem = rem - count;
                if (val != wrem)
                {
                    Console.WriteLine("NO");
                    return;
                }

                foreach (var item in v)
                {
                    res[item] = a;
                }

                a++;
                rem -= count;
            }

            Console.WriteLine("YES");
            Console.WriteLine(string.Join(" ", res));
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] ReadIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] ReadLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
        static IEnumerable<TextReader> GetTests()
        {
            var tests = new List<string>();
            var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
            using (var resource = new StreamReader(Assembly.GetCallingAssembly().GetManifestResourceStream(resName)))
            {
                while (true)
                {
                    var nextText = new StringBuilder();
                    var endOfFile = false;
                    while (true)
                    {
                        var line = resource.ReadLine();

                        endOfFile = line == null;
                        if (endOfFile)
                        {
                            break;
                        }

                        if (line.Equals(_delim, StringComparison.Ordinal))
                        {
                            break;
                        }

                        nextText.AppendLine(line);
                    }

                    yield return new StringReader(nextText.ToString());

                    if (endOfFile)
                    {
                        break;
                    }
                }
            }
        }
#endif
    }
}


/*
csc -debug C.cs && mono --debug C.exe <<< "5
0 0 1 1 2
2 0 1 0 0"

csc -debug C.cs && mono --debug C.exe <<< "3
1 0 0
0 0 1"
-> no

csc -debug C.cs && mono --debug C.exe <<< "3
0 0 1
1 0 0"
-> 2 3 2

csc -debug C.cs && mono --debug C.exe <<< "3
0 0 2
0 0 0"

csc -debug C.cs && mono --debug C.exe <<< "5
0 0 0 1 3
3 1 0 0 0"

*/

using System;
using System.Collections.Generic;
using System.Linq;

public class HelloWorld {
    static public void Main () {
        SolveCodeForces();
    }

    public static void SolveCodeForces() {
        var n = int.Parse(Console.ReadLine());
        var L = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var R = Console.ReadLine().Split().Select(int.Parse).ToArray();

        var data = Enumerable.Range(0, n)
            .Select(i => new { i, l = L[i], r = R[i], sum = L[i] + R[i] })
            .GroupBy(a => a.sum)
            .Select(gr => new { sum = gr.Key, items = gr.OrderBy(a => a.l).ToArray() })
            .OrderBy(a => a.sum)
            .ToArray();

        var cursum = 0;
        var ans = Helpers.CreateArray(n, _ => -1);

        foreach (var curgroup in data) {

            if (cursum != curgroup.sum) {
                System.Console.WriteLine("NO");
                return;
            }

            if (cursum == 0) {
                foreach (var item in curgroup.items)
                    ans[item.i] = n;
            }

            else {
                foreach (var item in curgroup.items) {

                    var nleft = 0;
                    var nright = 0;
                    for (var i = 0; i < n; i++) {
                        if (i < item.i && ans[i] >= 0)
                            nleft++;
                        else if (i > item.i && ans[i] >= 0)
                            nright++;
                    }
                    if (nleft != item.l && nright != item.r) {
                        System.Console.WriteLine("NO");
                        return;
                    }

                    ans[item.i] = n - cursum;
                }
            }

            cursum += curgroup.items.Length;
        }

        System.Console.WriteLine("YES");
        System.Console.WriteLine(string.Join(" ", ans));
    }
}

public static class Helpers {
    public static T[] CreateArray<T>(int length, Func<int, T> itemCreate) {
        var result = new T[length];
        for (var i = 0; i < result.Length; i++)
            result[i] = itemCreate(i);
        return result;
    }

    public static T ElementWithMax<T>(this IEnumerable<T> seq, Func<T, long> func) {
        var bi = default(T);
        var bv = long.MinValue;
        foreach (var item in seq) {
            var v = func(item);
            if (v > bv) {
                bi = item;
                bv = v;
            }
        }
        return bi;
    }
}


/*
csc -debug C.cs && mono --debug C.exe <<< "5
0 0 1 1 2
2 0 1 0 0"

csc -debug C.cs && mono --debug C.exe <<< "3
1 0 0
0 0 1"
-> no

csc -debug C.cs && mono --debug C.exe <<< "3
0 0 1
1 0 0"
-> 2 3 2

csc -debug C.cs && mono --debug C.exe <<< "3
0 0 2
0 0 0"

csc -debug C.cs && mono --debug C.exe <<< "5
0 0 0 1 3
3 1 0 0 0"

*/

using System;
using System.Collections.Generic;
using System.Linq;

public class HelloWorld {
    static public void Main () {
        SolveCodeForces();
    }

    public static void SolveCodeForces() {
        var n = int.Parse(Console.ReadLine());
        var L = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var R = Console.ReadLine().Split().Select(int.Parse).ToArray();

        var ans = new int[n];
        for (var i = 0; i < n; i++)
            ans[i] = n - L[i] - R[i];

        for (var i = 0; i < n; i++) {
            var left = 0;
            var right = 0;
            for (var j = 0; j < n; j++)
                if (j < i && ans[j] > ans[i])
                    left++;
                else if (j > i && ans[j] > ans[i])
                    right++;
            if (left != L[i] || right != R[i]) {
                System.Console.WriteLine("NO");
                return;
            }
        }

        System.Console.WriteLine("YES");
        System.Console.WriteLine(string.Join(" ", ans));
    }
}

public static class Helpers {
    public static T[] CreateArray<T>(int length, Func<int, T> itemCreate) {
        var result = new T[length];
        for (var i = 0; i < result.Length; i++)
            result[i] = itemCreate(i);
        return result;
    }

    public static T ElementWithMax<T>(this IEnumerable<T> seq, Func<T, long> func) {
        var bi = default(T);
        var bv = long.MinValue;
        foreach (var item in seq) {
            var v = func(item);
            if (v > bv) {
                bi = item;
                bv = v;
            }
        }
        return bi;
    }
}


using System;
using System.Linq;
using System.Collections.Generic;

class Solution
{
	static void Main (string[] args)
	{
		int n = int.Parse (Console.ReadLine ());
		int[] l = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();
		int[] r = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();

		int[] result = new int[n];
		int val = n;
		while (true) {
			List<int> hits = new List<int> ();
			for (int i = 0; i < n; i++) {
				if (l [i] == 0 && r [i] == 0)
					hits.Add (i);
			}
			if (hits.Count == 0)
				break;

			int sub = 0;
			for (int setL = 0; setL < n; setL++) {
				if (sub < hits.Count && hits [sub] == setL)
					sub++;
				l [setL] -= sub;
			}
			sub = 0;
			for (int setR = n-1; setR >= 0; setR--) {
				if (sub < hits.Count && hits [sub] == setR)
					sub++;
				r [setR] -= sub;
			}

			foreach (int h in hits)
				result [h] = val;
			val--;
		}

		if (result.Any(re => re == 0)) {
			Console.WriteLine ("NO");
		}
		else {
			Console.WriteLine ("YES");
			Console.WriteLine (string.Join (" ", result));
		}
	}
}


using System;
using System.Linq;
using System.Collections.Generic;

class Solution
{
	static Random random = new Random (0);

	static int[] Solve (int n, int[] l, int[] r)
	{
		int[] result = new int[n];
		int val = n;
		while (true) {
			List<int> hits = new List<int> ();
			for (int i = 0; i < n; i++) {
				if (l [i] == 0 && r [i] == 0)
					hits.Add (i);
			}
			if (hits.Count == 0)
				break;

			int sub = 0;
			for (int setL = 0; setL < n; setL++) {
				if (sub < hits.Count && hits [sub] == setL)
					sub++;
				l [setL] -= sub;
			}
			sub = 0;
			for (int setR = n - 1; setR >= 0; setR--) {
				if (sub < hits.Count && hits [hits.Count - sub - 1] == setR)
					sub++;
				r [setR] -= sub;
			}

			foreach (int h in hits)
				result [h] = val;
			val--;
		}
		return result;
	}

	static bool Test ()
	{
		int n = random.Next (50, 101);
		int[] vals = new int[n];
		for (int i = 0; i < n; i++) {
			vals [i] = 1 + random.Next (n);
		}

		int[] l = new int[n];
		int[] r = new int[n];
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (vals [i] < vals [j])
					r [i]++;
				if (vals [i] > vals [j])
					l [j]++;
			}
		}

		int[] cmp = Solve (n, l.ToArray (), r.ToArray ());
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (vals [i] > vals [j] && cmp [i] <= cmp [j]) {
					Console.WriteLine (n);
					Console.WriteLine (string.Join (" ", l));
					Console.WriteLine (string.Join (" ", r));
					Console.WriteLine (" ==> ");
					Console.WriteLine (string.Join (" ", vals));
					Console.WriteLine (string.Join (" ", cmp));
					return false;
				}
			}
		}
		return true;
	}

	static void Main (string[] args)
	{
		//while (Test ())
		;

		int n = int.Parse (Console.ReadLine ());
		int[] l = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();
		int[] r = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();

		int[] result = Solve (n, l, r);
		if (result.Any (re => re == 0)) {
			Console.WriteLine ("NO");
		} else {
			Console.WriteLine ("YES");
			Console.WriteLine (string.Join (" ", result));
		}
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
//using System.Numerics;
using static System.Math;
using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    readonly Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; }
    void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; }

    bool checking(long[] A, int[] L, int[] R)
    {
        for (int i = 0; i < A.Length; i++)
        {
            if (A[i] <= 0)
            {
                A[i] = 1;
            }
        }
        for (int i = 0; i < A.Length; i++)
        {
            int cntl = 0;
            for (int j = 0; j < i; j++)
            {
                if (A[j] > A[i])
                {
                    cntl++;
                }
            }
            if (L[i] != cntl)
            {
                return false;
            }
            int cntr = 0;
            for (int j = i + 1; j < A.Length; j++)
            {
                if (A[j] > A[i])
                {
                    cntr++;
                }
            }
            if (R[i] != cntr)
            {
                return false;
            }
        }
        return true;
    }
    void solve()
    {
        int N = cin.nextint;
        var L = cin.scanint;
        var R = cin.scanint;
        var P = new pair[N];
        var ID = new int[N];
        var E = new Edge[N];
        for (int i = 0; i < N; i++)
        {
            //P[i] = new pair(L[i], R[i]);
            E[i] = new Edge(L[i], R[i], Max(L[i], R[i]));
            E[i].set_id(i);
        }
        //P = P.OrderBy(i => Max(i.f,i.s)).ToArray();
        E = E.OrderBy(i => i.cost).ThenBy(i => i.from + i.to).ToArray();
        var A = new long[N];

        var cntzerozero = false;
        var cntN = false;

        foreach (var v in E)
        {
            if (v.cost == 0)
            {
                cntzerozero = true;
            }
            if (v.cost == N)
            {
                cntN = true;
            }

            var expect = N - v.cost;
            int cnt = 0;
            for (int i = 0; i < v.id; i++)
            {
                if (A[i] > expect)
                {
                    cnt++;
                }
            }
            int cnt2 = 0;
            for (int i = v.id + 1; i < N; i++)
            {
                if (A[i] > expect)
                {
                    cnt2++;
                }
            }

            if (cnt < v.from || cnt2 < v.to)
            {
                expect--;
            }

            A[v.id] = expect;
        }
        if (checking(A, L, R))
        {
            WriteLine("YES");
            WriteLine(cin.join(A));
        }
        else
        {
            WriteLine("NO");
            //WriteLine(cin.join(A));
        }

    }

}

struct Edge : IComparable<Edge>
{
    public int from, to, id; public long cost;
    public Edge(int from, int to, long cost)
    {
        this.from = from;
        this.to = to;
        this.cost = cost;
        id = -1;
    }
    public void set_id(int id)
    {
        this.id = id;
    }
    public int CompareTo(Edge e)
    {
        return cost.CompareTo(e.cost);
    }
}
class Pair<T, U> : IComparable<Pair<T, U>> where T : IComparable<T> where U : IComparable<U>
{
    public T f;
    public U s;
    public Pair(T f, U s)
    {
        this.f = f;
        this.s = s;
    }
    public int CompareTo(Pair<T, U> a)
    {
        return f.CompareTo(a.f) != 0 ? f.CompareTo(a.f) : s.CompareTo(a.s);
    }
    public override string ToString()
    {
        return f + " " + s;
    }
}
class Scanner
{
    string[] s; int i;
    readonly char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
    public string join<T>(IEnumerable<T> values) { return string.Join(" ", values); }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;
//using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    readonly Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; }
    void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; }

    void solve()
    {
        int N = cin.nextint;
        var L = cin.scanint;
        var R = cin.scanint;

        var A = new int[N];
        for (int i = 0; i < N; i++)
        {
            A[i] = N - L[i] - R[i];
        }

        bool flag = true;
        for (int i = 0; i < N; i++)
        {
            flag &= 1 <= A[i];
            int cnt = 0;
            for (int j = i + 1; j < N; j++)
            {
                if (A[i] < A[j])
                {
                    cnt++;
                }
            }
            flag &= cnt == R[i];
        }

        for (int i = N - 1; i >= 0; i--)
        {
            int cnt = 0;
            for (int j = i - 1; j >= 0; j--)
            {
                if (A[i] < A[j])
                {
                    cnt++;
                }
            }
            flag &= cnt == L[i];
        }

        if (flag)
        {
            WriteLine("YES");
            cin.join(A);
        }
        else
        {
            WriteLine("NO");
        }
    }

}

class Scanner
{
    string[] s; int i;
    readonly char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
    public void join<T>(IEnumerable<T> values) { WriteLine(string.Join(" ", values)); }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace C.DistributionOfCandy
{
    class Program
    {
        static void Main(string[] args)
        {
            int childrenCount = Convert.ToInt32(Console.ReadLine());
            var leftIndexesStr = Console.ReadLine()?.Split(new[] { ' ' }, childrenCount);
            var rightIndexesStr = Console.ReadLine()?.Split(new[] { ' ' }, childrenCount);

            var leftIndexes = new int[childrenCount];
            for (int i = 0; i < childrenCount ; i++)
            {
                leftIndexes[i] = Convert.ToInt32(leftIndexesStr[i]);
            }

            var rightIndexes = new int[childrenCount];
            for (int i = 0; i < childrenCount; i++)
            {
                rightIndexes[i] = Convert.ToInt32(rightIndexesStr[i]);
            }

            var result = GetAnswer(childrenCount, leftIndexes, rightIndexes, out var amountCandy);
            if (result)
            {
                Console.WriteLine("YES");
                foreach (var i in amountCandy)
                {
                    Console.Write(i + " ");
                }
            }
            else
            {
                Console.WriteLine("NO");
            }

            Console.Read();
        }

        private static bool GetAnswer(int childrenCount, int[] leftIndexes, int[] rightIndexes, out int[] amountCandy)
        {
            amountCandy = new int[childrenCount];
            var answer = false;

            if (leftIndexes.First() > 0 || rightIndexes.Last() > 0) return answer;

            var maxAmountIndex = GetMaxAmountIndex(childrenCount, leftIndexes, rightIndexes);
            if (maxAmountIndex.Count == 0) return answer;
            foreach (var i in maxAmountIndex)
            {
                amountCandy[i] = childrenCount;
            }
            //amountCandy[maxAmountIndex] = childrenCount;

            var leftIndexesSumm = 0;
            var rightIndexesSumm = 0;
            for (int i = 0; i < childrenCount; i++)
            {
                if(amountCandy[i] > 0) continue;

                if (leftIndexesSumm > leftIndexes[i]) return answer;
                leftIndexesSumm = leftIndexesSumm + leftIndexes[i];

                if (rightIndexesSumm > rightIndexes[childrenCount-1]) return answer;
                rightIndexesSumm = rightIndexesSumm + rightIndexes[childrenCount - 1];
            }

            for (int i = 0; i < childrenCount; i++)
            {
                var wantedAmount = childrenCount - leftIndexes[i] - rightIndexes[i];
                if (wantedAmount == 0) return answer;
                amountCandy[i] = wantedAmount;
            }

            //for (int i = maxAmountIndex+1; i < childrenCount; i++)
            //{
            //    var wantedAmount = maxAmountIndex - leftIndexes[i] + rightIndexes[i];
            //    if (wantedAmount == 0) return answer;
            //    amountCandy[i] = wantedAmount;
            //}

            //for (int i = maxAmountIndex - 1; i <= 0; i--)
            //{
            //    var wantedAmount = maxAmountIndex - leftIndexes[i] + rightIndexes[i];
            //    if (wantedAmount == 0) return answer;
            //    amountCandy[i] = wantedAmount;
            //}

            return true;
        }

        private static List<int> GetMaxAmountIndex(int count, int[] leftIndexes, int[] rightIndexes)
        {
            var result = new List<int>();

            for (int i = 0; i < count; i++)
            {
                if (leftIndexes[i] == 0 && rightIndexes[i] == 0)
                    result.Add(i);
            }

            return result;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace C.DistributionOfCandy
{
    class Program
    {
        static void Main(string[] args)
        {
            int childrenCount = Convert.ToInt32(Console.ReadLine());
            var leftIndexesStr = Console.ReadLine()?.Split(new[] { ' ' }, childrenCount);
            var rightIndexesStr = Console.ReadLine()?.Split(new[] { ' ' }, childrenCount);

            var leftIndexes = new int[childrenCount];
            for (int i = 0; i < childrenCount ; i++)
            {
                leftIndexes[i] = Convert.ToInt32(leftIndexesStr[i]);
            }

            var rightIndexes = new int[childrenCount];
            for (int i = 0; i < childrenCount; i++)
            {
                rightIndexes[i] = Convert.ToInt32(rightIndexesStr[i]);
            }

            var result = GetAnswer(childrenCount, leftIndexes, rightIndexes, out var amountCandy);
            if (result)
            {
                Console.WriteLine("YES");
                foreach (var i in amountCandy)
                {
                    Console.Write(i + " ");
                }
            }
            else
            {
                Console.WriteLine("NO");
            }

            Console.Read();
        }

        private static bool GetAnswer(int childrenCount, int[] leftIndexes, int[] rightIndexes, out int[] amountCandy)
        {
            amountCandy = new int[childrenCount];
            var answer = false;

            if (leftIndexes.First() > 0 || rightIndexes.Last() > 0) return answer;

            for (int i = 0; i < childrenCount; i++)
            {
                var wantedAmount = childrenCount - leftIndexes[i] - rightIndexes[i];
                if (wantedAmount == 0) return answer;
                amountCandy[i] = wantedAmount;
            }

            for (int i = 0; i < childrenCount; i++)
            for (int j = 0; j < i; j++)
                if (amountCandy[j] > amountCandy[i])
                    leftIndexes[i] = leftIndexes[i] - 1;

            for (int i = 0; i < childrenCount; i++)
            for (int j = i + 1; j < childrenCount; j++)
                if (amountCandy[j] > amountCandy[i])
                    rightIndexes[i] = rightIndexes[i] - 1;

            for (int i = 0; i < childrenCount; i++)
                if (leftIndexes[i] != 0 || rightIndexes[i] != 0)
                    return answer;

            return true;
        }

        private static List<int> GetMaxAmountIndex(int count, int[] leftIndexes, int[] rightIndexes)
        {
            var result = new List<int>();

            for (int i = 0; i < count; i++)
            {
                if (leftIndexes[i] == 0 && rightIndexes[i] == 0)
                    result.Add(i);
            }

            return result;
        }
    }
}