#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long double EPS = 0.00000001;
const long double PI = 3.1415926535897932384626433;
long long int N, M, K, H, W, L, R;
vector<vector<int>> edge;
vector<int> weight;
bool flag = true;
int Search(int num) {
  if (edge[num].empty()) {
    return 0;
  }
  int sum = 0;
  int bag = 0;
  for (auto i : edge[num]) {
    sum += weight[i] + Search(i);
    bag = min(weight[i], Search(i));
  }
  if (bag > weight[num]) {
    flag = false;
  }
  sum -= max(bag, weight[num]);
  if (sum < 0) {
    flag = false;
    return 0;
  }
  return sum;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  edge.resize(N + 1);
  weight.resize(N + 1);
  for (int i = 2; i <= N; i++) {
    cin >> L;
    edge[L].push_back(i);
  }
  for (int i = 1; i <= N; i++) {
    cin >> weight[i];
  }
  Search(1);
  if (flag) {
    cout << "POSSIBLE\n";
  } else {
    cout << "IMPOSSIBLE\n";
  }
  return 0;
}
