#include <bits/stdc++.h>
using namespace std;
int val[1010], db[1010], dw[1010], vaz[1010], p = 0;
vector<int> v[1010];
void dfs(int nod) {
  vaz[nod] = 1;
  for (int i = 0; i < v[nod].size(); i++)
    if (vaz[v[nod][i]] == 0) dfs(v[nod][i]);
  int w = 0, b = 0;
  for (int i = 0; i < v[nod].size(); i++) {
    int vec = v[nod][i];
    w += dw[vec];
    b += db[vec];
  }
  dw[nod] = w;
  db[nod] = b;
  if (w <= val[nod])
    dw[nod] = val[nod];
  else if (b <= val[nod])
    db[nod] = val[nod];
  else
    p = 1;
}
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x);
    v[x].push_back(i);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &val[i]);
  dfs(1);
  if (p == 1)
    printf("IMPOSSIBLE");
  else
    printf("POSSIBLE");
  return 0;
}
