#include <bits/stdc++.h>
using namespace std;
int N;
int P[1010];
int X[1010];
vector<vector<int> > G(1010);
int oth[1010];
int ok;
void dfs(int u) {
  int i;
  int v;
  if (ok == 0) return;
  if (G[u].size() == 0) {
    oth[u] = 0;
    return;
  }
  for (i = 0; i < G[u].size(); i++) {
    v = G[u][i];
    dfs(v);
  }
  v = G[u][0];
  int a1 = X[v], a2 = oth[v];
  if (a1 > a2) swap(a1, a2);
  int a[4];
  for (i = 1; i < G[u].size(); i++) {
    v = G[u][i];
    a[0] = a1 + X[v];
    a[1] = a2 + X[v];
    a[2] = a1 + oth[v];
    a[3] = a2 + oth[v];
    sort(a, a + 4);
    a1 = a[0];
    a2 = a[1];
  }
  if (a1 > X[u]) {
    ok = 0;
    return;
  } else {
    if (a2 > X[u]) {
      oth[u] = a2;
    } else
      oth[u] = a1;
  }
}
void solve() {
  int i;
  for (i = 1; i < N; i++) {
    G[P[i]].push_back(i);
  }
  ok = 1;
  dfs(0);
  if (ok)
    printf("POSSIBLE\n");
  else
    printf("IMPOSSIBLE\n");
}
int main() {
  int i;
  scanf("%d", &N);
  for (i = 1; i < N; i++) {
    scanf("%d", &P[i]);
    P[i]--;
  }
  for (i = 0; i < N; i++) scanf("%d", &X[i]);
  solve();
  return 0;
}
