#include <bits/stdc++.h>
using ll = long long;
using P = std::pair<ll, ll>;
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << "[" << pa.first << ", " << pa.second << "]";
}
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  os << "{";
  for (int i = 0; i < vec.size(); i++)
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  os << "}";
  return os;
}
const ll MOD = 1e9 + 7;
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  ll n;
  std::cin >> n;
  std::vector<ll> x(n), v(n, 0);
  std::vector<std::vector<ll>> graph(n);
  for (ll(i) = (1); i < (n); i++) {
    ll p;
    std::cin >> p;
    p--;
    graph[p].push_back(i);
  }
  for (ll(i) = (0); i < (n); i++) std::cin >> x[i];
  for (ll i = n - 1; i >= 0; i--) {
    if (!graph[i].empty()) {
      ll min = 0;
      std::vector<ll> dif;
      for (ll c : graph[i]) {
        min += std::min(x[c], v[c]);
        v[i] += std::max(x[c], v[c]);
        dif.push_back(std::abs(x[c] - v[c]));
      }
      if (min > x[i]) {
        std::cout << "IMPOSSIBLE";
        return 0;
      }
      std::sort(dif.begin(), dif.end());
      ll now = 0;
      while (min + dif[now] <= x[i]) {
        min += dif[now];
        v[i] -= dif[now];
        now++;
      }
    }
  }
  std::cout << "POSSIBLE";
  return 0;
}
