#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> vt;
int gap[1010];
int sz[1010];
void dfs(int here) {
  if (vt[here].size() == 0) sz[here] = gap[here];
  for (int i = 0; i < vt[here].size(); i++) {
    int next = vt[here][i];
    dfs(next);
    sz[here] += sz[next];
  }
}
int main() {
  int n;
  scanf("%d", &n);
  vt.resize(n + 1);
  for (int i = 2; i <= n; i++) {
    int q;
    scanf("%d", &q);
    vt[q].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &gap[i]);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    int xx = 0;
    for (int y = 0; y < vt[i].size(); y++) {
      int next = vt[i][y];
      xx += min(gap[next], sz[next] - gap[next]);
    }
    if (xx > gap[i]) {
      puts("IMPOSSIBLE");
      return 0;
    }
  }
  puts("POSSIBLE");
}
