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.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 23 01:48:24 2020

@author: divyarth
"""

import sys
import heapq
import math

#sys.setrecursionlimit(100000)
#input=sys.stdin.readline
#print=sys.stdout.write

from collections import deque
from collections import defaultdict
from collections import Counter

modH=int(10**9)+7
I=lambda : list(map(int,input().split(' ')))
def PRINT(lst,sep=' '): print(sep.join(map(str,lst)))

n=int(input())
lst=I()
edge=I()

class DSU:
    def __init__(self,p,r):
        self.p=p
        self.r=r
        
def find(s,n):
    if s[n].p!=n:
        s[n].p=find(s,s[n].p)
    return s[n].p

def union(s,x,y):
    xx=find(s,x)
    yy=find(s,y)
    if xx==yy:
        return True
    else:
        x=s[xx]
        y=s[yy]
        if x.r<y.r:
            x.p=y.p
        elif x.r>y.r:
            y.p=x.p
        else:
            x.p=y.p
            y.r+=1
        return False

subsets=[DSU(i,0) for i in range(n)]

for i in range(n):
    d=edge[i]
    if i+d<n:        
        union(subsets,i,i+d)
    if i-d>=0:
        union(subsets,i,i-d)

for i in range(n):
    find(subsets,i)
    
if not all([find(subsets,i)==find(subsets,lst[i]-1) for i in range(n)]):
    print('NO')
else:
    print('YES')