#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using llu = long long unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
int N;
vector<vi> ch;
vi a(N);
bool ans = true;
pii dfs(int from) {
  vii b;
  for (int to : ch[from]) {
    b.push_back(dfs(to));
  }
  vii dp;
  dp.push_back({0, 0});
  vii dpv;
  for (pii t : b) {
    for (pii d : dp) {
      int ai, bi;
      ai = d.first + t.first;
      bi = d.second + t.second;
      if (ai <= a[from]) dpv.push_back({ai, bi});
      ai = d.first + t.second;
      bi = d.second + t.first;
      if (ai <= a[from]) dpv.push_back({ai, bi});
    }
    dp.clear();
    for (pii d : dpv) {
      dp.push_back(d);
    }
    dpv.clear();
    if (dp.size() == 0) ans = false;
  }
  if (!ans) return {(2e9), (2e9)};
  int r1 = -1, r2 = -1;
  for (pii d : dp) {
    if (d.first > r1) {
      r1 = d.first;
      r2 = d.second;
    }
  }
  return {a[from], r2};
}
int main() {
  scanf("%d", &N);
  ch.resize(N);
  a.resize(N);
  int x;
  for (ll i = 0; i < N - 1; i++) {
    scanf("%d", &x);
    ch[--x].push_back(i + 1);
  }
  for (ll i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  dfs(0);
  printf("%sPOSSIBLE\n", ans ? "" : "IM");
  return 0;
}
