#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 1005;
long long N;
vector<long long> edge[MAX_N];
long long X[MAX_N];
long long sumX[MAX_N];
long long calcSumX(long long pos) {
  long long ret = X[pos];
  for (long long i = 0; i < edge[pos].size(); i++) {
    calcSumX(edge[pos][i]);
    ret += X[edge[pos][i]];
  }
  return sumX[pos] = ret;
}
long long dp[MAX_N][2];
long long solve(long long pos, long long color) {
  if (dp[pos][color] != -1) {
    return dp[pos][color];
  }
  long long nextColor = (color + 1) % 2;
  long long k = 0;
  for (long long d = 0; d < edge[pos].size(); d++) {
    long long next = edge[pos][d];
    if (!solve(next, nextColor) && !solve(next, color)) {
      return dp[pos][color] = 0;
    } else if (!solve(next, nextColor) && solve(next, color)) {
      k += X[next];
    } else if (solve(next, nextColor) && !solve(next, color)) {
      k += sumX[next] - X[next];
    } else {
      k += min(X[next], sumX[next] - X[next]);
    }
  }
  return dp[pos][color] = (k <= X[pos]);
}
signed main() {
  cin >> N;
  for (long long i = 1; i < N; i++) {
    long long p;
    cin >> p;
    p--;
    edge[p].push_back(i);
  }
  for (long long i = 0; i < N; i++) {
    cin >> X[i];
  }
  calcSumX(0);
  memset(dp, -1, sizeof(dp));
  if (solve(0, 0)) {
    cout << "POSSIBLE" << endl;
  } else {
    cout << "IMPOSSIBLE" << endl;
  }
  return 0;
}
