#include <bits/stdc++.h>
using namespace std;
int n, a[1000000 + 100], sol, bb[100], boja[5000], p[1000000 + 100],
    bela[10000], crna[10000];
string s;
vector<int> v[1000000 + 100];
bool obidjen[1000000 + 100], ne;
void dfs(int x) {
  obidjen[x] = 1;
  for (int i = 0; i < v[x].size(); i++) {
    int y = v[x][i];
    if (obidjen[y]) continue;
    dfs(y);
  }
  if (boja[x] == 0 && bela[x] > a[x]) ne = true;
  if (boja[x] == 1 && crna[x] > a[x]) ne = true;
  if (boja[x] == 0) bela[x] = a[x];
  if (boja[x] == 1) crna[x] = a[x];
  bela[p[x]] += bela[x];
  crna[p[x]] += crna[x];
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++)
    scanf("%d", &p[i]), v[i].push_back(p[i]), v[p[i]].push_back(i);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (n == 1) {
    cout << "POSSIBLE" << endl;
    return 0;
  }
  int pok = 70000;
  srand(time(NULL));
  while (pok--) {
    ne = false;
    bb[0] = 0;
    bb[1] = 0;
    for (int i = 1; i <= n; i++) obidjen[i] = 0;
    for (int i = 1; i <= n; i++) boja[i] = rand() % 2;
    for (int i = 1; i <= n; i++) bela[i] = 0, crna[i] = 0;
    dfs(1);
    if (ne == false) {
      cout << "POSSIBLE" << endl;
      return 0;
    }
  }
  cout << "IMPOSSIBLE" << endl;
  return 0;
}
