#include <bits/stdc++.h>
using namespace std;
int n;
int deg[5005], fa[5005];
int val[5005], sum[5005][2];
inline void read(int &x) {
  x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
}
void bfs() {
  queue<int> que;
  for (int i = 1; i <= n; ++i)
    if (!deg[i]) {
      que.push(i);
    }
  while (!que.empty()) {
    int u = que.front();
    que.pop();
    if (sum[u][0] <= val[u]) {
      if (sum[u][1] <= val[u] && sum[u][1] > sum[u][0]) {
        sum[u][1] = val[u];
      } else {
        sum[u][0] = val[u];
      }
    } else if (sum[u][1] <= val[u]) {
      sum[u][1] = val[u];
    } else {
      puts("IMPOSSIBLE");
      exit(0);
    }
    int v = fa[u];
    sum[v][0] += sum[u][0], sum[v][1] += sum[u][1];
    if (!--deg[v]) que.push(v);
  }
  return;
}
int main() {
  read(n);
  for (int i = 2; i <= n; ++i) read(fa[i]), ++deg[fa[i]];
  for (int i = 1; i <= n; ++i) read(val[i]);
  bfs();
  puts("POSSIBLE");
  return 0;
}
