#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 7;
vector<int> q[N];
int dian[N];
bool in[N];
bool bfs() {
  queue<int> p;
  p.push(1);
  in[1] = 1;
  int u, v;
  int tmp = 0;
  while (!p.empty()) {
    u = p.front();
    p.pop();
    tmp = 0;
    for (int i = 0; i < q[u].size(); i++) {
      v = q[u][i];
      if (in[v]) continue;
      p.push(v);
      for (int j = 0; j < q[v].size(); j++) {
        if (in[q[v][j]]) continue;
        tmp += dian[q[v][j]];
      }
    }
    if (tmp > dian[u]) return false;
  }
  return true;
}
int main() {
  int n, a;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    scanf("%d", &a);
    q[a].push_back(i);
    q[i].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &dian[i]);
  }
  if (bfs())
    cout << "POSSIBLE" << endl;
  else
    cout << "IMPOSSIBLE" << endl;
}
