One day *n* cells of some array decided to play the following game. Initially each cell contains a number which is equal to it's ordinal number (starting from 1). Also each cell determined it's favourite number. On it's move *i*-th cell can exchange it's value with the value of some other *j*-th cell, if |*i* - *j*| = *d*<sub class="lower-index">*i*</sub>, where *d*<sub class="lower-index">*i*</sub> is a favourite number of *i*-th cell. Cells make moves in any order, the number of moves is unlimited.

The favourite number of each cell will be given to you. You will also be given a permutation of numbers from 1 to *n*. You are to determine whether the game could move to this state.
The first line contains positive integer *n* (1 ≤ *n* ≤ 100) — the number of cells in the array. The second line contains *n* distinct integers from 1 to *n* — permutation. The last line contains *n* integers from 1 to *n* — favourite numbers of the cells.
#If you win, you live. You cannot win unless you fight.
# remember hash hack use tuple
import string
from sys import  stdin,setrecursionlimit
input=stdin.readline
rd=lambda: map(lambda s: int(s), input().strip().split())
rdG=lambda: map(lambda s: int(s)-1, input().strip().split())
ri=lambda: int(input())
rs=lambda :input().strip()
setrecursionlimit(10**5)
from collections import defaultdict,deque,Counter
from bisect import bisect_left as bl, bisect_right as br
from math import gcd, ceil, floor,log2,factorial
class dsu():
	def __init__(self,n):
		self.parent=[0]*(n)
		self.sz=[0]*(n)

	def make_set(self,v):
		self.parent[v]=v
		self.sz[v]=1

	def find_set(self,v):
		if v==self.parent[v]:
			return v
		self.parent[v]=self.find_set(self.parent[v])
		return self.parent[v]

	def union(self,a,b):
		a=self.find_set(a)
		b=self.find_set(b)
		if a==b:
			return
		if self.sz[a]<self.sz[b]:
			a,b=b,a
		self.parent[b]=a
		self.sz[a]+=self.sz[b]

	def getsize(self,v):
		return self.sz[self.find_set(v)]


n=ri()
a=list(rdG())
d=list(rd())
ds=dsu(n)
for i in range(n):
    ds.make_set(i)
# print(a)
for i in range(n):
    if i-d[i]>=0 :
        ds.union(i,i-d[i])
    if i+d[i]<n:
        ds.union(i,i+d[i])
comp=defaultdict(list)
for i in range(n):
    comp[ds.find_set(i)].append(i)
fla=True
for i in comp:
    l=comp[i]
    ll=[a[j] for j in l]
    if l!=sorted(ll):
        fla=False
if fla:
    print("YES")
else:
    print("NO")
