#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10, INF = 5e3 + 10;
int n, a[N], f[N];
vector<int> g[N];
void dfs(int first) {
  for (int second : g[first]) {
    dfs(second);
    int ret = INF;
    if (a[first] >= a[second]) ret = min(ret, f[second]);
    if (a[first] >= f[second]) ret = min(ret, a[second]);
    f[first] += ret;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    int first;
    scanf("%d", &first);
    g[first].push_back(i);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  dfs(1);
  puts(f[1] >= INF ? "IMPOSSIBLE" : "POSSIBLE");
}
