#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = 100100100100100100;
long long int N;
long long int p[2000];
long long int X[2000];
pair<long long int, long long int> node_sum[2000];
queue<long long int> next;
bool appear[2000];
pair<long long int, long long int> saiki(long long int index) {
  if (appear[index]) {
    return node_sum[index];
  }
  pair<long long int, long long int> child_sum = make_pair(0, 0);
  for (long long int i = 0; i < N - 1; i++) {
    if (p[i + 1] == index) {
      pair<long long int, long long int> tmp = saiki(i + 1);
      child_sum.first += min(tmp.first, tmp.second);
      child_sum.second += max(tmp.first, tmp.second);
    }
  }
  if (child_sum.second <= X[index]) {
    child_sum.second = X[index];
  } else if (child_sum.first <= X[index]) {
    child_sum.first = X[index];
  } else {
    child_sum.first = INF;
    child_sum.second = INF;
  }
  return child_sum;
}
int main() {
  cin >> N;
  for (long long int i = 0; i < N - 1; i++) {
    cin >> p[i + 1];
    p[i + 1]--;
  }
  for (long long int i = 0; i < N; i++) {
    cin >> X[i];
    node_sum[i] = make_pair(0, X[i]);
    appear[i] = true;
  }
  for (long long int i = 0; i < N - 1; i++) {
    node_sum[p[i + 1]] = make_pair(0, 0);
    appear[p[i + 1]] = false;
  }
  pair<long long int, long long int> ans = saiki(0);
  if (ans.first == INF) {
    cout << "IMPOSSIBLE" << endl;
  } else {
    cout << "POSSIBLE" << endl;
  }
}
