#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;
Graph G;
vector<int> X, dp;
int dfs(int v, int p, int n) {
  int misum = 0;
  for (auto nv : G[v]) {
    int tmp1 = dfs(nv, v, n);
    if (tmp1 == -1) return -1;
    dp[v] += tmp1;
  }
  if (p == -1) return dp[v];
  int mi = INF;
  if (X[p] >= X[v])
    mi = dp[v];
  else if (X[p] < X[v] && X[p] >= dp[v])
    mi = X[p];
  return (mi != INF) ? mi : -1;
}
int main() {
  int N;
  cin >> N;
  G.resize(N);
  X.resize(N);
  dp.resize(N + 5);
  for (int i = 1; i < N; ++i) {
    int P;
    cin >> P;
    P--;
    G[P].push_back(i);
  }
  for (int i = 0; i < N; ++i) cin >> X[i];
  int ans = dfs(0, -1, N);
  if (ans == -1 || ans > X[0])
    cout << "IMPOSSIBLE" << endl;
  else
    cout << "POSSIBLE" << endl;
  return 0;
}
