#include <bits/stdc++.h>
using namespace std;
int n;
int p[1005] = {0};
int x[1005] = {0};
int dp[1005][2] = {0};
void prians(bool answer) {
  if (answer)
    cout << "POSSIBLE" << endl;
  else
    cout << "IMPOSSIBLE" << endl;
}
bool solve();
int main() {
  cin >> n;
  for (int i = 1; i < n; ++i) {
    cin >> p[i];
    --p[i];
  }
  for (int i = 0; i < n; ++i) cin >> x[i];
  prians(solve());
  return 0;
}
bool solve() {
  for (int i = n - 1; i >= 0; --i) {
    if (i == 0 && (dp[i][0] <= x[i] || dp[i][1] <= x[i])) return 1;
    if (dp[i][0] > x[i] && dp[i][1] > x[i])
      break;
    else if (dp[i][0] <= x[i] && dp[i][1] <= x[i]) {
      if (dp[i][0] > dp[i][1]) swap(dp[i][0], dp[i][1]);
      dp[i][1] = x[i];
      if (dp[i][0] > dp[i][1]) swap(dp[i][0], dp[i][1]);
      dp[p[i]][0] += dp[i][0];
      dp[p[i]][1] += dp[i][1];
    } else {
      if (dp[i][0] > dp[i][1]) swap(dp[i][0], dp[i][1]);
      dp[i][0] = x[i];
      if (dp[i][0] > dp[i][1]) swap(dp[i][0], dp[i][1]);
      dp[p[i]][0] += dp[i][0];
      dp[p[i]][1] += dp[i][1];
    }
  }
  return 0;
}
