#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int maxn = 1e3 + 10;
const double eps = 1e-9;
int to[maxn << 1], beg[maxn << 1], nex[maxn << 1], x[maxn], sum[maxn];
int e;
inline int read() {
  int x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') flag = -1, ch = getchar();
  while (isdigit(ch)) x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x * flag;
}
inline void add(int x, int y) {
  to[++e] = y;
  nex[e] = beg[x];
  beg[x] = e;
}
void dfs(int cur, int fa) {
  int i;
  for (i = beg[cur]; i; i = nex[i]) {
    if (to[i] == fa) continue;
    dfs(to[i], cur);
    if (x[to[i]] > x[cur]) sum[cur] += sum[x[to[i]]];
    if (sum[cur] > x[cur]) {
      printf("IMPOSSIBLE\n");
      exit(0);
    } else
      sum[cur] = x[cur];
  }
}
int main() {
  int i, j, k, m, n;
  n = read();
  for (i = 2; i <= n; i++) {
    int x = read();
    add(x, i);
    add(i, x);
  }
  for (i = 1; i <= n; i++) x[i] = read();
  dfs(1, 0);
  printf("POSSIBLE\n");
  return 0;
}
