#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
vector<int> G[N];
int w[N], dp[N], c[N];
bool dfs(int k) {
  int W = 0, B = 0;
  for (int i = G[k].size() - 1; i >= 0; i--) {
    int u = G[k][i];
    if (!dfs(u)) return false;
    B += c[u] ? w[u] : dp[u];
    W += !c[u] ? w[u] : dp[u];
  }
  if (w[k] < min(B, W)) return false;
  if (w[k] >= max(B, W))
    c[k] = B < W ? W : B, dp[k] = min(B, W);
  else
    c[k] = B < W ? B : W, dp[k] = max(B, W);
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int a, i = 2; i <= n; i++) {
    scanf("%d", &a);
    G[a].push_back(i);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &w[i]);
  if (dfs(1))
    cout << "POSSIBLE";
  else
    cout << "IMPOSSIBLE";
  return 0;
}
