#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] >= white && x[i] >= black) {
      if (white < black) {
        if (tree[p[i]].first > tree[p[i]].second) {
          tree[p[i]].first += x[i];
          tree[p[i]].second += white;
        } else {
          tree[p[i]].second += x[i];
          tree[p[i]].first += white;
        }
        v[i] = x[i] - black;
      } else {
        if (tree[p[i]].first > tree[p[i]].second) {
          tree[p[i]].first += x[i];
          tree[p[i]].second += black;
        } else {
          tree[p[i]].second += x[i];
          tree[p[i]].first += black;
        }
        v[i] = x[i] - white;
      }
    } else if (x[i] < white && x[i] >= black) {
      if (pwh > pbl) {
        pbl += x[i];
        pwh += white;
      } else {
        pbl += white;
        pwh += x[i];
      }
    } else if (x[i] < black && x[i] >= white) {
      if (pwh > pbl) {
        pbl += x[i];
        pwh += black;
      } else {
        pbl += black;
        pwh += x[i];
      }
      v[i] = x[i] - white;
    } else {
      ope++;
      break;
    }
  }
  if (ope == 0)
    cout << "POSSIBLE" << endl;
  else
    cout << "IMPOSSIBLE" << endl;
  return 0;
}
