#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int N = 1005;
int n, x[N], p[N];
vector<int> g[N];
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> p[i];
    g[i].push_back(p[i]);
    g[p[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) cin >> x[i];
  puts("POSSIBLE");
}
