#include <bits/stdc++.h>
using namespace std;
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, -1, 0, 1};
template <class T>
void inputVector(vector<T>& v, long long n) {
  v.resize(n);
  for (long long i = 0; i < v.size(); i++) cin >> v[i];
}
class Node {
 public:
  long long id;
  long long parent;
  long long x;
  long long color;
  long long sum[2];
  Node() {}
  Node(long long i, long long p, long long x) {
    id = i;
    parent = p;
    this->x = x;
    color = 0;
    sum[0] = 0;
    sum[1] = 0;
  }
};
long long N;
vector<Node> nodes;
bool solve() {
  for (long long i = N - 1; i >= 0; i--) {
    Node& node = nodes[i];
    if (node.sum[0] <= node.x) {
      node.sum[0] = node.x;
    } else if (node.sum[1] <= node.x) {
      node.sum[1] = node.x;
    } else {
      return false;
    }
    if (node.id != 0) {
      nodes[node.parent].sum[0] += node.sum[0];
      nodes[node.parent].sum[1] += node.sum[1];
    }
  }
  return true;
}
signed main() {
  cin >> N;
  vector<long long> P, X;
  inputVector(P, N - 1);
  inputVector(X, N);
  for (long long i = 0; i < (N - 1); i++) P[i]--;
  nodes.push_back(Node(0, -1, X[0]));
  for (long long i = 0; i < (N - 1); i++) {
    nodes.push_back(Node(i + 1, P[i], X[i + 1]));
  }
  cout << (solve() ? "POSSIBLE" : "IMPOSSIBLE") << endl;
  return 0;
}
