#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long long LINF = 2e18;
void inv(bool e);
template <typename T>
T sign(T a);
template <typename T>
void die(T &a);
template <typename T>
void umax(T &a, T b);
template <typename T>
void umin(T &a, T b);
bool brute, alter;
int cnt_tests = 1;
const int N = 1e3 + 3;
long long E[N];
vector<int> tree[N];
int n;
void inp() {
  cin >> n;
  int p;
  for (int i = 2; i <= n; ++i) {
    cin >> p;
    tree[i].push_back(p);
    tree[p].push_back(i);
  }
  for (int i = 1; i <= n; ++i) {
    cin >> E[i];
  }
}
bool bad[N];
long long minEl[N];
bool ans = true;
void dfs(int v, int p = -1) {
  minEl[v] = INF;
  int k = 0;
  for (auto u : tree[v]) {
    if (u == p) {
      continue;
    }
    dfs(u, v);
    umin(minEl[v], minEl[u]);
    if (bad[u]) {
      bad[v] = true;
    }
    ++k;
  }
  if (bad[v] && minEl[v] > E[v]) {
    ans = false;
  }
  if (minEl[v] > E[v] && k != 0) {
    bad[v] = true;
  }
  umin(minEl[v], E[v]);
}
void solve() {
  dfs(1);
  if (ans) {
    cout << "POSSIBLE";
  } else {
    cout << "IMPOSSIBLE";
  }
}
void stress() {}
void naive() {}
void run();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (0) {
    freopen("palindrome.in", "r", stdin);
    freopen("palindrome.out", "w", stdout);
  }
  srand(time(0));
  brute = false;
  for (int i = 0; (i < cnt_tests); i++) {
    run();
  }
  cerr << '\n' << "Time: " << clock() / 1000.0 << " ms";
  return 0;
}
void run() {
  if (!brute) {
    inp();
  } else {
    stress();
  }
  solve();
  cout << '\n';
}
template <typename T>
void die(T &a) {
  cout << a;
  exit(0);
}
template <typename T>
T sign(T a) {
  if (a == 0) return 0;
  if (a < 0) return -1;
  return 1;
}
template <typename T>
void umax(T &a, T b) {
  if (b > a) a = b;
}
template <typename T>
void umin(T &a, T b) {
  if (b < a) a = b;
}
void inv(bool e) {
  if (!e) {
    vector<int> a;
    a[-1] += 1;
  }
}
