#include <bits/stdc++.h>
using namespace std;
struct edge {
  int from, to;
  long long cost;
};
vector<pair<int, int> > pairs(1001, pair<int, int>(0, 0));
vector<int> es[1001], xs(1001);
bool dfs(int node) {
  bool ret = true;
  pair<int, int> sum_pair = pair<int, int>(0, 0);
  for (int next : es[node]) {
    ret &= dfs(next);
    sum_pair.first += pairs[next].first;
    sum_pair.second += pairs[next].second;
  }
  if (es[node].empty()) {
    pairs[node] = pair<int, int>(xs[node], 0);
  } else {
    if (sum_pair.first <= xs[node]) {
      pairs[node] = pair<int, int>(xs[node], sum_pair.second);
    } else if (sum_pair.second <= xs[node]) {
      pairs[node] = pair<int, int>(sum_pair.first, xs[node]);
    } else {
      ret = false;
    }
  }
  return ret;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << "POSSIBLE";
    return 0;
  }
  for (int i = 1; i <= n - 1; i++) {
    int par;
    cin >> par;
    es[par - 1].push_back(i);
  }
  for (int i = 0; i < n; i++) cin >> xs[i];
  if (dfs(0)) {
    cout << "POSSIBLE";
  } else {
    cout << "IMPOSSIBLE";
  }
  return 0;
}
