#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000001;
int num[MAXN];
int dist[MAXN];
int parent[MAXN];
int Find(int u) { return u == parent[u] ? u : parent[u] = Find(parent[u]); }
void Union(int u, int v) {
  int Ru = Find(u), Rv = Find(v);
  if (Ru == Rv) return;
  parent[Ru] = Rv;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
    parent[i] = i;
    num[i]--;
  }
  for (int i = 0; i < n; i++) cin >> dist[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (abs(i - j) == dist[i]) Union(i, j);
  for (int i = 0; i < n; i++)
    if (Find(i) != Find(num[i])) {
      cout << "NO" << '\n';
      return 0;
    }
  cout << "YES" << '\n';
  return 0;
}
