#include <bits/stdc++.h>
using namespace std;
int n;
int p[1024];
int x[1024];
int maxmin[1024], minmin[1024];
int main(void) {
  cin >> n;
  vector<vector<int> > c(n + 1);
  vector<int> vtmp;
  for (int i = 1; i <= n; i++) c[i] = vtmp;
  for (int i = 2; i <= n; i++) {
    cin >> p[i];
    c[p[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = n; i >= 1; i--) {
    int minminsum = 0, maxminsum = 0;
    for (int j = 0; j < c[i].size(); j++) {
      minminsum += minmin[c[i][j]];
      maxminsum += maxmin[c[i][j]];
    }
    if (maxminsum <= x[i]) {
      maxmin[i] = x[i];
      minmin[i] = minminsum;
    } else if (minminsum <= x[i]) {
      maxmin[i] = maxminsum;
      minmin[i] = x[i];
    } else {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  }
  cout << "POSSIBLE" << endl;
  return 0;
}
