#include <bits/stdc++.h>
using namespace std;
int n;
int p[1050];
int x[1050];
pair<int, int> tree[1050];
int v[1050];
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> p[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  int ope = 0;
  for (int i = n; i > 0; i--) {
    int white = tree[i].first;
    int black = tree[i].second;
    int pwh = tree[p[i]].first;
    int pbl = tree[p[i]].second;
    if (x[i] >= black) {
      if (pbl + x[i] <= x[p[i]] || pwh + x[i] > x[p[i]]) {
        tree[p[i]].first += white;
        tree[p[i]].second += x[i];
      } else {
        tree[p[i]].first += x[i];
        tree[p[i]].second += white;
      }
      v[i] = x[i] - black;
    } else if (x[i] >= white) {
      if (pbl + black <= x[p[i]] || pwh + black > x[p[i]]) {
        tree[p[i]].first += x[i];
        tree[p[i]].second += black;
      } else {
        tree[p[i]].first += black;
        tree[p[i]].second += x[i];
      }
      v[i] = x[i] - white;
    } else {
      ope++;
      break;
    }
    if (tree[p[i]].first > tree[p[i]].second)
      swap(tree[p[i]].first, tree[p[i]].second);
  }
  if (ope == 0)
    cout << "POSSIBLE" << endl;
  else
    cout << "IMPOSSIBLE" << endl;
  return 0;
}
