#include <bits/stdc++.h>
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
using long long int = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
class Solve {
 public:
  Int N;
  vector<vector<Int>> tree;
  vector<Int> X;
  pair<Int, Int> dfs(Int v, Int p = -1) {
    if (v != 0 && tree[v].size() == 1) {
      return make_pair(X[v], 0ll);
    }
    vector<pair<Int, Int>> ab;
    Int sum = 0;
    for (auto e : tree[v]) {
      if (e != p) {
        pair<Int, Int> tmp = dfs(e, v);
        if (tmp.first == -1 || tmp.second == -1) {
          return make_pair(-1, -1);
        }
        sum += tmp.first + tmp.second;
        ab.push_back(tmp);
      }
    }
    vector<bool> dp(5001);
    if (!ab.empty()) {
      if (ab.back().first < dp.size()) {
        dp[ab.back().first] = true;
      }
      if (ab.back().second < dp.size()) {
        dp[ab.back().second] = true;
      }
      ab.pop_back();
    }
    for (auto e : ab) {
      for (int i = dp.size() - 1; i >= 0; --i) {
        if (dp[i] && i + e.first < dp.size()) {
          dp[i] = true;
        }
        if (dp[i] && i + e.second < dp.size()) {
          dp[i] = true;
        }
      }
    }
    Int max_f = -1;
    for (int i = 0; i <= X[v]; ++i) {
      if (dp[i]) max_f = i;
    }
    if (max_f == -1) {
      return make_pair(-1, -1);
    }
    pair<Int, Int> ret(X[v], sum - max_f);
    return ret;
  }
  void solve() {
    cin >> N;
    tree.resize(N);
    X.resize(N);
    for (int i = 1; i < N; ++i) {
      Int a, b;
      a = i;
      cin >> b;
      b--;
      tree[a].push_back(b);
      tree[b].push_back(a);
    }
    for (int i = 0; i < N; ++i) cin >> X[i];
    if (N == 1) {
      cout << "POSSIBLE" << endl;
      return;
    }
    auto tapi = dfs(0);
    if ((tapi.first <= X[0] || tapi.second <= X[0]) &&
        (tapi.first != -1 && tapi.second != -1)) {
      cout << "POSSIBLE" << endl;
    } else {
      cout << "IMPOSSIBLE" << endl;
    }
  }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  Solve().solve();
  return 0;
}
