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.
from __future__ import division
from sys import stdin, stdout
from queue import PriorityQueue
from heapq import *
from collections import deque, defaultdict, Counter
from bitarray import bitarray
input_int = lambda: int(stdin.readline())
input_1D_int = lambda: [int(x) for x in stdin.readline().split()]
input_2D_int = lambda n: [input_1D_int() for _ in range(n)]
input_string = lambda: stdin.readline().strip()
input_1D_string = lambda: [str(x) for x in stdin.readline().split()]
input_2D_string = lambda n: [input_1D_string() for _ in range(n)]
pr = lambda args, sep: stdout.write(sep.join(map(str, args)) + '\n')
chars, oo = 'abcdefghijklmnopqrstuvwxyz', int(1000000000000000000)
class DSU:
    def __init__(self, n):
        self.groupSize = [0] * (n + 1)
        self.parent = [0] * (n + 1)
        self.rank = [0] * (n + 1)
        self.mx = [0] * (n + 1)
        self.mn = [0] * (n + 1)
        for i in range(n + 1):
            self.parent[i] = i
            self.mx[i] = self.mn[i] = i
            self.groupSize[i] = 1
            self.rank[i] = 0
    def make_set(self, u):
        self.parent[u] = u
        self.groupSize[u] = 1
    def find_set(self, x):
        if self.parent[x] == x: return x
        self.parent[x] = self.find_set(self.parent[x])
        return self.parent[x]
    def union_set(self, u, v):
        leader1 = self.find_set(u)
        leader2 = self.find_set(v)
        if leader1 == leader2: return
        if self.groupSize[leader1] < self.groupSize[leader2]:
            leader1, leader2 = leader2, leader1
        self.parent[leader2] = leader1
        self.groupSize[leader1] += self.groupSize[leader2]
        if self.rank[leader1] == self.rank[leader2]:
            self.rank[leader1] += 1
        self.mx[leader1] = max(self.mx[leader1], self.mx[leader2])
        self.mn[leader1] = min(self.mn[leader1], self.mn[leader2])
    def samegroup(self, u, v):
        leader1 = self.find_set(u)
        leader2 = self.find_set(v)
        return leader1 == leader2
    def sizeGroup(self, u):
        leader = self.find_set(u)
        return self.groupSize[leader]
    def get_max(self, u):
        return self.mx[self.find_set(u)]
    def get_min(self, u):
        return self.mn[self.find_set(u)]
n = input_int()
a = input_1D_int()
b = input_1D_int()
dsu = DSU(n + 10)
for i in range(0, n):
    r = (i + 1) + b[i]
    l = (i + 1) - b[i]
    if r > 0 and r <= n:dsu.union_set(r, i + 1)
    if l <= n and l > 0:dsu.union_set(l, i + 1)
for i in range(0, n):
    if dsu.find_set(a[i]) != dsu.find_set(i + 1):
        print("NO")
        exit()
print("YES")
