#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int INF = 1e9;
const ll LINF = 1e18;
const double dINF = 1e18;
const ld ldINF = 1e18;
const double EPS = 1e-6;
template <typename T, typename U, typename O>
void caut(T a, U b, O c) {
  cout << "(" << a << "," << b << "," << c << ") ";
}
template <typename T, typename U>
void caut(T a, U b) {
  cout << "(" << a << "," << b << ") ";
}
template <typename T>
void caut(T a) {
  cout << "(" << a << ") ";
}
using P = pair<int, int>;
const ll M = 1e9 + 7, mx = 200000;
void add(ll& x, ll y) {
  x += y;
  x %= M;
}
void chmax(ll& x, ll y) {
  if (x < y) x = y;
}
int n, x[1000], sm[1000];
vector<int> nx[1000];
bool dfs(int id) {
  if (nx[id].empty()) {
    sm[id] = x[id];
    return true;
  }
  bool ok = true;
  int small = 0;
  sm[id] = 0;
  for (int c : nx[id]) {
    ok &= dfs(c);
    if (!ok) break;
    small += min(x[c], sm[c] - x[c]);
    sm[id] += sm[c];
  }
  if (!ok) return ok;
  sm[id] += x[id];
  ok = small <= x[id];
  return ok;
}
int main() {
  cin >> n;
  int p[n];
  for (int i = 1; i < n; i++) cin >> p[i];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 1; i < n; i++) {
    p[i]--;
    nx[p[i]].push_back(i);
  }
  if (dfs(0))
    cout << "POSSIBLE" << endl;
  else
    cout << "IMPOSSIBLE" << endl;
}
