#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 5e18;
long long n;
vector<long long> w(1010), b(1010), x(1010);
vector<set<long long>> p(1010);
bool dfs(long long f) {
  for (long long t : p[f]) {
    if (!dfs(t)) {
      return false;
    }
    if (w[f] < b[f]) {
      w[f] += max(w[t], b[t]);
      b[f] += min(w[t], b[t]);
    } else {
      b[f] += max(w[t], b[t]);
      w[f] += min(w[t], b[t]);
    }
  }
  if (min(w[f], b[f]) > x[f]) return false;
  if (w[f] > b[f]) {
    if (w[f] <= x[f]) {
      w[f] = x[f];
    } else {
      b[f] = x[f];
    }
  } else {
    if (b[f] <= x[f]) {
      b[f] = x[f];
    } else {
      w[f] = x[f];
    }
  }
  return true;
}
int main() {
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long tmp;
    cin >> tmp;
    p[tmp - 1].insert(i);
  }
  for (long long i = 0; i < n; i++) cin >> x[i];
  if (dfs(0)) {
    cout << "POSSIBLE" << endl;
  } else {
    cout << "IMPOSSIBLE" << endl;
  }
}
