#include <bits/stdc++.h>
long long int MOD = 998244353;
using namespace std;
string alphabet("abcdefghijklmnopqrstuvwxyz");
pair<int, int> x[1100] = {};
vector<int> v[1100];
int check(int y) {
  int dp[1100][5000] = {};
  dp[0][0] = 1;
  int sum = 0;
  for (int i = 0; i < v[y].size(); i++) {
    sum += x[v[y][i]].first + x[v[y][i]].second;
    if (sum > 10000) break;
  }
  for (int i = 1; i <= v[y].size(); ++i) {
    int l = x[v[y][i - 1]].first, r = x[v[y][i - 1]].second;
    for (int j = 0; j <= 5000; ++j) {
      if (j >= l) dp[i][j] = dp[i - 1][j - l];
      if (j >= r) dp[i][j] = dp[i][j] || dp[i - 1][j - r];
    }
  }
  int tt = -1;
  for (int i = x[y].first; i >= 0; i--) {
    if (dp[v[y].size()][i]) {
      tt = i;
      break;
    }
  }
  if (tt == -1) return -1;
  return x[y].second = sum - tt;
}
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    int p;
    scanf("%d", &p);
    v[p].push_back(i);
  }
  bool ans = true;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x[i].first);
  }
  int rk[1100] = {};
  rk[1] = 1;
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    int t = q.front();
    q.pop();
    int s = rk[t];
    for (int i = 0; i < v[t].size(); i++) {
      rk[v[t][i]] = s + 1;
      q.push(v[t][i]);
    }
  }
  priority_queue<pair<int, int> > p;
  for (int i = 1; i <= n; ++i) {
    p.push({rk[i], i});
  }
  cout << "POSSIBLE";
  return 0;
}
