#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
vector<vector<long long>> childs;
long long N;
vector<long long> X;
vector<pair<long long, long long>> DP;
int main() {
  cin >> N;
  childs.resize(N);
  X.resize(N);
  for (long long n = 1; n < N; n++) {
    long long p;
    cin >> p;
    p--;
    childs[p].push_back(n);
  }
  for (long long n = 0; n < N; n++) cin >> X[n];
  DP.resize(N);
  for (long long n = N - 1; n >= 0; n--) {
    if (childs[n].size() == 0) {
      DP[n] = pair<long long, long long>(X[n], 0);
      continue;
    }
    long long smallsum = 0, bigsum = 0;
    for (long long child : childs[n]) {
      smallsum += DP[child].second;
      bigsum += DP[child].first;
    }
    if (bigsum <= X[n])
      DP[n] = pair<long long, long long>(X[n], smallsum);
    else if (smallsum <= X[n])
      DP[n] = pair<long long, long long>(bigsum, X[n]);
    else {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  }
  cout << "POSSIBLE" << endl;
  return 0;
}
