#include <bits/stdc++.h>
using namespace std;
int n, ans;
int p[1005];
int a[1005][2];
vector<int> from[1005];
void dfs(int u) {
  for (auto v : from[u]) {
    dfs(v);
    for (int i = 0; i < 2; i++) a[u][i] += a[v][i];
  }
  if (a[u][1] <= p[u])
    a[u][1] = p[u];
  else if (a[u][0] <= p[u])
    a[u][0] = p[u];
  else
    ans = 0;
  if (a[u][0] > a[u][1]) swap(a[u][0], a[u][1]);
}
int main() {
  int i, x;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) scanf("%d", &x), from[x].push_back(i);
  for (i = 1; i <= n; i++) scanf("%d", &p[i]);
  ans = 1;
  dfs(1);
  if (ans)
    printf("POSSIBLE");
  else
    printf("IMPOSSIBLE");
}
