#include <bits/stdc++.h>
using namespace std;
int n;
struct Edge {
  int to, next;
} edge[10011];
int first[10011], le = 2, v[10011], now[10011];
void in(int x, int y) {
  Edge &e = edge[le];
  e.to = y;
  e.next = first[x];
  first[x] = le++;
}
bool flag = 0;
void dfs(int x, int z) {
  if (x == 1) {
    for (int i = first[x]; i; i = edge[i].next) {
      Edge &e = edge[i];
      dfs(e.to, z);
    }
  } else if (z == -1) {
    z = x;
    for (int i = first[x]; i; i = edge[i].next) {
      Edge &e = edge[i];
      dfs(e.to, z);
    }
  } else {
    if (v[x] > v[1])
      flag = 1;
    else if (v[x] > v[z]) {
      now[1] += now[z];
      z = x;
    }
    if (now[z] + v[x] > v[z])
      now[1] += v[x];
    else
      now[z] += v[x];
    for (int i = first[x]; i; i = edge[i].next) {
      Edge &e = edge[i];
      dfs(e.to, z);
    }
  }
}
int main() {
  scanf("%d", &n);
  int x;
  for (int i = 2; i <= n; i++) scanf("%d", &x), in(i, x);
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]);
  memset(now, 0, sizeof(now));
  dfs(1, -1);
  for (int i = 1; i <= n; i++)
    if (now[i] > v[i]) flag = 1;
  if (flag)
    puts("IMPOSSIBLE");
  else
    puts("POSSIBLE");
  return 0;
}
