#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
pair<int, int> dfs(int v, const Graph& G, const vector<int>& X,
                   vector<int>& sum) {
  pair<int, int> res(0, 0);
  for (auto to : G[v]) {
    sum[v] += sum[to];
    auto p = dfs(to, G, X, sum);
    res.first = max(res.first, p.first);
    res.second = max(res.second, p.second);
  }
  sum[v] = max(sum[v], res.first + res.second);
  if (X[v] < res.second) {
    cout << "IMPOSSIBLE" << endl;
    exit(0);
  } else if (X[v] < res.first || X[v] * 2 < sum[v]) {
    sum[v] += X[v] - res.second;
    res.second = X[v];
    auto tmp = sum[v] - res.second;
    if (tmp > 0) {
      sum[v] += max(0, res.first - tmp);
      res.first = max(res.first, tmp);
    }
  } else {
    sum[v] += X[v] - res.first;
    res.first = X[v];
  }
  return res;
}
int main() {
  int N;
  cin >> N;
  Graph G(N);
  vector<int> X(N);
  for (int i = 1, P; i < N; i++) {
    cin >> P;
    G[P - 1].push_back(i);
  }
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  vector<int> sum(N);
  dfs(0, G, X, sum);
  cout << "POSSIBLE" << endl;
  return 0;
}
