#include <bits/stdc++.h>
namespace io {
int F() {
  int n = 0, F = 1;
  char ch;
  while ((ch = getchar()) != '-' && (ch < '0' || ch > '9'))
    ;
  ch == '-' ? F = 0 : n = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9')
    n = (n << 1) + (n << 3) + ch - '0';
  return F ? n : -n;
}
long long G() {
  long long n = 0, F = 1;
  char ch;
  while ((ch = getchar()) != '-' && (ch < '0' || ch > '9'))
    ;
  ch == '-' ? F = 0 : n = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9')
    n = (n << 1) + (n << 3) + ch - '0';
  return F ? n : -n;
}
}  // namespace io
int f[1111];
int g[2][5005];
int fa[1111];
int x[1111];
struct edge {
  int to;
  int next;
} e[2222];
int pe = 1111;
void insert(int a, int to) {
  e[pe] = (edge){to, e[a].next};
  e[a].next = pe++;
}
int main() {
  int n = io::F();
  for (register int i = 2; i <= n; ++i) fa[i] = io::F(), insert(fa[i], i);
  for (register int i = 1; i <= n; ++i) x[i] = io::F();
  for (register int i = n; i; --i) {
    memset(g, 63, sizeof(g));
    g[0][0] = 0;
    int *X = g[0], *Y = g[1];
    for (register int p = e[i].next; p;
         p = e[p].next, std::swap(X, Y), memset(Y, 63, sizeof(f[0])))
      for (register int j = 0; j <= 5000; ++j) {
        if (j >= x[e[p].to])
          (Y[j] > (X[j - x[e[p].to]] + f[e[p].to])
           ? Y[j] = (X[j - x[e[p].to]] + f[e[p].to]),
           1 : 0);
        if (j >= f[e[p].to])
          (Y[j] > (X[j - f[e[p].to]] + x[e[p].to])
           ? Y[j] = (X[j - f[e[p].to]] + x[e[p].to]),
           1 : 0);
      }
    f[i] = 0x3f3f3f3f;
    for (register int j = 0; j <= x[i]; ++j)
      (f[i] > (X[j]) ? f[i] = (X[j]), 1 : 0);
  }
  puts("POSSIBLE");
  return 0;
}
