#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(const T& x) {
  cout << x << endl;
}
template <class T, class... A>
void print(const T& first, const A&... rest) {
  cout << first << " ";
  print(rest...);
}
struct PreMain {
  PreMain() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} premain;
int N;
int X[1000];
vector<int> G[1000];
int dp[1001];
int dfs(int v) {
  if (dp[v] >= 0) return dp[v];
  int sz = G[v].size();
  if (sz == 0) return 0;
  int sm = 0;
  for (auto c : G[v]) {
    dp[c] = dfs(c);
    if (dp[c] == -1) {
      return -1;
    }
    sm += dfs(c) + X[c];
  }
  set<int> sms;
  for (int(l) = 0; (l) < (int)(1 << sz); ++(l)) {
    int n = l;
    int tmp = 0;
    for (auto c : G[v]) {
      tmp += (n & 1) ? dp[c] : X[c];
      n >>= 1;
    }
    sms.insert(tmp);
  }
  auto it = sms.upper_bound(X[v]);
  if (it == sms.begin()) {
    return -1;
  }
  int min_value = sm - *(--it);
  return min_value;
}
int main() {
  cin >> N;
  for (int(i) = 1; (i) < (int)(N); ++(i)) {
    int p;
    cin >> p;
    G[--p].emplace_back(i);
  }
  for (int(i) = 0; (i) < (int)(N); ++(i)) cin >> X[i];
  for (int(i) = 0; (i) < (int)(N); ++(i)) dp[i] = -1;
  int ans = dfs(0);
  if (ans == -1) {
    print("IMPOSSIBLE");
  } else {
    print("POSSIBLE");
  }
  return 0;
}
