#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int n = 0;
  bool b = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') b = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    n = (n << 3) + (n << 1) + (c ^ 48), c = getchar();
  return b ? -n : n;
}
queue<int> q[1100];
int n, a[1100], siz[1100], sum[1100];
int main() {
  n = read();
  for (int i = 2; i <= n; ++i) {
    q[read()].push(i);
  }
  for (int i = 1; i <= n; ++i) {
    a[i] = read();
    siz[i] = q[i].size();
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= siz[i]; ++j) {
      int t = q[i].front();
      sum[i] += a[t];
      q[i].pop();
      q[i].push(t);
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!siz[i]) continue;
    if (a[i] != sum[i]) {
      int now = INT_MAX, id;
      for (int j = 1; j <= siz[i]; ++j) {
        int t = q[i].front();
        if (sum[i] - (a[t] << 1) + sum[t] < now) {
          id = t;
          now = sum[i] - (a[t] << 1) + sum[t];
        }
        q[i].pop();
        q[i].push(t);
      }
      for (int j = 1; j <= siz[i]; ++j) {
        if (j == id) continue;
        int t = q[i].front();
        if (sum[t] - a[t] < a[t]) {
          now += sum[t] - a[t];
        } else
          now += a[t];
        q[i].pop();
        q[i].push(t);
      }
      if (now > a[i]) {
        puts("IMPOSSIBLE");
        return 0;
      }
    }
  }
  puts("POSSIBLE");
  return 0;
}
