#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  for (; !isalnum(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isalnum(ch); ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
long long sum[1100], w[1100];
bool color[1100], key;
vector<long long> e[1100];
inline void dfs(long long g) {
  sum[g] = w[g];
  long long ans1 = 0, ans2 = 0;
  for (long long i = 0; i <= (long long)e[g].size() - 1; i++) {
    dfs(e[g][i]);
    if (color[e[g][i]])
      ans1 += w[e[g][i]];
    else
      ans1 += (sum[e[g][i]] - w[e[g][i]]);
    ans2 += sum[e[g][i]];
  }
  if (w[g] - min(ans1, ans2 - ans1) < 0) {
    key++;
    return;
  }
  if (w[g] - ans1 >= 0) {
    if (ans1 < ans2 - ans1 && w[g] - ans2 + ans1 >= 0)
      sum[g] = w[g] + ans1;
    else {
      color[g] = true;
      sum[g] = w[g] + ans2 - ans1;
    }
  } else
    sum[g] = w[g] + ans1;
}
signed main() {
  long long n = read();
  for (long long i = 2; i <= n; i++) {
    long long x = read();
    e[x].push_back(i);
  }
  for (long long i = 1; i <= n; i++) w[i] = read();
  dfs(1);
  if (key)
    printf("IMPOSSIBLE\n");
  else
    printf("POSSIBLE\n");
  return 0;
}
