#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long expo(long long base, long long pow) {
  long long ans = 1;
  while (pow != 0) {
    if (pow & 1 == 1) {
      ans = ans * base;
      ans = ans % mod;
    }
    base *= base;
    base %= mod;
    pow /= 2;
  }
  return ans;
}
long long inv(long long x) { return expo(x, mod - 2); }
unsigned long long llrand() {
  unsigned long long r = 0;
  for (int i = 0; i < 5; ++i) {
    r = (r << 15) | (rand() & 0x7FFF);
  }
  return r & 0xFFFFFFFFFFFFFFFFULL;
}
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int M = 1001;
vector<int> vec[M];
int val[M], color[M][2], extra[M][2];
bool ok = 1;
void dfs(int u) {
  int black = 0, white = 0;
  for (int i = 0; i < vec[u].size(); i++) {
    int v = vec[u][i];
    dfs(v);
    white += color[v][0] + extra[v][0];
    black += color[v][1] + extra[v][1];
    extra[u][0] += extra[v][0];
    extra[u][1] += extra[v][1];
    color[u][0] += color[v][0];
    color[u][1] += color[v][1];
  }
  if (black <= val[u] && white <= val[u]) {
    extra[u][0] += (val[u] - white);
    extra[u][1] += (val[u] - black);
  } else if (black > val[u] && white > val[u]) {
    ok = false;
    return;
  } else if (black <= val[u]) {
    color[u][1] += (val[u] - black);
  } else if (white <= val[u]) {
    color[u][0] += (val[u] - white);
  }
}
int main() {
  int n;
  scanf("%d", &(n));
  for (int i = 2; i <= n; i++) {
    int a;
    scanf("%d", &(a));
    vec[a].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &(val[i]));
  }
  dfs(1);
  if (ok) {
    cout << "POSSIBLE";
  } else {
    cout << "IMPOSSIBLE";
  }
}
