#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3fll;
const int MAX = 1e5 + 5;
const int MAX_N = MAX;
const long long MOD = 1e9 + 7;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template <typename T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
template <class T>
inline void read(T& num) {
  bool start = false, neg = false;
  char c;
  num = 0;
  while ((c = getchar()) != EOF) {
    if (c == '-')
      start = neg = true;
    else if (c >= '0' && c <= '9') {
      start = true;
      num = num * 10 + c - '0';
    } else if (start)
      break;
  }
  if (neg) num = -num;
}
inline long long powMM(long long a, long long b, long long M) {
  long long ret = 1;
  a %= M;
  while (b) {
    if (b & 1) ret = ret * a % M;
    b >>= 1;
    a = a * a % M;
  }
  return ret;
}
void open() { freopen("out.txt", "w", stdout); }
int n, tem, a[1005];
long long sum[1005];
bool lin, an;
vector<int> edge[1005];
queue<pair<int, int> > que;
bool bfs() {
  que.push(make_pair(1, false));
  while (!que.empty()) {
    tem = que.front().first;
    lin = true;
    bool st = que.front().second;
    que.pop();
    int now = a[tem];
    long long tot = 0;
    for (int i = 0; i < edge[tem].size(); i++) {
      tot += sum[edge[tem][i]] - a[edge[tem][i]];
      if (now >= a[edge[tem][i]]) {
        lin = false;
        break;
      }
    }
    if (now >= tot) lin = false;
    for (int i = 0; i < edge[tem].size(); i++) {
      que.push(make_pair(edge[tem][i], lin));
    }
    if (lin && st && !edge[tem].empty()) return false;
  }
  return true;
}
inline void update(int now, int no, int num) {
  for (int i = 0; i < edge[now].size(); i++) {
    if (edge[now][i] == no) continue;
    a[edge[now][i]] += num;
  }
}
long long dfs(int now) {
  if (edge[now].size() == 0) {
    return sum[now] = a[now];
  }
  long long re = 0;
  for (int i = 0; i < edge[now].size(); i++) {
    re += dfs(edge[now][i]);
  }
  return sum[now] = re;
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &tem);
    edge[tem].push_back(i);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  dfs(1);
  if (bfs())
    printf("POSSIBLE\n");
  else
    printf("IMPOSSIBLE\n");
  return 0;
}
