#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1ll << 60;
const double pi = acos(-1);
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
int n;
vector<int> a, b;
vector<vector<int> > g;
bool dfs(int v) {
  vector<int> c;
  int s = 0, S = 0;
  bool B = 1;
  for (auto u : g[v]) {
    B &= dfs(u);
    S += max(a[u], b[u]);
    s += min(a[u], b[u]);
    c.push_back(S - s);
  }
  int N = a[v] - s + 1;
  if (N <= 0 || !B) return 0;
  vector<int> dp(N);
  dp[0] = 1;
  for (int i = 0; i < c.size(); i++)
    for (int j = N - c[i] - 1; j >= 0; j--) dp[j + c[i]] |= dp[j];
  for (int i = 0; i < N; i++)
    if (dp[i]) b[v] = S - i;
  return 1;
}
int main() {
  cin >> n;
  g = vector<vector<int> >(n);
  a = b = vector<int>(n);
  for (int i = 1; i < n; i++) {
    int v;
    cin >> v;
    g[v - 1].push_back(i);
  }
  for (int i = 0; i < n; i++) cin >> a[i];
  if (dfs(0))
    cout << "POSSIBLE" << endl;
  else
    cout << "IMPOSSIBLE" << endl;
}
