#include <bits/stdc++.h>
using namespace std;
const long long N = 100030;
const long long mod = 998244353;
struct edge {
  int b;
  int w;
};
int n;
edge no[1015];
vector<int> g[N];
bool bo[2000];
int arr[2000];
pair<int, int> dfs(int idx) {
  bool b = false;
  bo[idx] = true;
  pair<int, int> p1, p2;
  for (auto x : g[idx]) {
    if (!bo[x]) {
      b = true;
      bo[x] = true;
      p2 = dfs(x);
      p1.first += p2.first;
      p1.second += p2.second;
    }
  }
  if (b) {
    if (p1.first > p1.second) {
      if (arr[idx] >= p1.first)
        return {arr[idx], p1.second};
      else if (arr[idx] >= p1.second)
        return {p1.first, arr[idx]};
      else {
        cout << "IMPOSSIBLE";
        exit(0);
      }
    } else {
      if (arr[idx] >= p1.second)
        return {p1.first, arr[idx]};
      else if (arr[idx] >= p1.first)
        return {arr[idx], p2.second};
      else {
        cout << "IMPOSSIBLE";
        exit(0);
      }
    }
  }
  if (!b) {
    return {arr[idx], 0};
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a;
    b = i + 1;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  for (int i = 1; i <= n; i++) cin >> arr[i];
  dfs(1);
  cout << "POSSIBLE";
}
