#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000;
int n, p[maxn + 1], X[maxn + 1], color[maxn + 1], sumB[maxn + 1],
    sumW[maxn + 1];
vector<int> V[maxn + 1];
bool flag;
void dfs(int x) {
  if (!flag) return;
  sumB[x] = 0;
  sumW[x] = 0;
  for (auto it = V[x].begin(); it != V[x].end(); it++) {
    dfs(*it);
    if (!flag) return;
    sumB[x] += sumB[*it];
    sumW[x] += sumW[*it];
  }
  if (sumB[x] > X[x] and sumW[x] > X[x]) {
    flag = false;
    return;
  } else if (sumB[x] <= X[x] and sumW[x] <= X[x]) {
    int c = rand() % 2;
    if (c == 0)
      sumB[x] = X[x];
    else
      sumW[x] = X[x];
  } else if (sumB[x] <= X[x])
    sumB[x] = X[x];
  else if (sumW[x] <= X[x])
    sumW[x] = X[x];
}
int main() {
  ios_base::sync_with_stdio(0);
  srand(time(NULL));
  cin >> n;
  for (int i = 1; i <= n; i++) V[i].clear();
  for (int i = 2; i <= n; i++) {
    cin >> p[i];
    V[p[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) cin >> X[i];
  do {
    flag = true;
    dfs(1);
    if (flag) break;
  } while (clock() / (long double)CLOCKS_PER_SEC <= 1.90);
  if (flag)
    cout << "POSSIBLE";
  else
    cout << "IMPOSSIBLE";
  return 0;
}
