/*input

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;

#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")

#define F first
#define S second
#define mp make_pair
#define append push_back
#define mem(a,b) memset(a,b,sizeof(a))
#define ll long long int
#define pb push_back
#define print(a) cout<<a<<endl
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define all(x) x.begin(), x.end()
#define loop(i,n) for(int i = 0; i < n; i++)
#define getName(x) #x
#define debug(x) cerr<< getName(x) << ":" << x << endl;
//#define int long long int
 
const int MOD = 1e9 + 7;

int fastexpo(int x, int y) 
{ 
    int res = 1;
    x = x % MOD;
    while (y) 
    { 
        if (y & 1) res = (res*x) % MOD; 
        y = y>>1;
        x = (x*x) % MOD;   
    } 
    return res; 
}

int mod(int x, int y){
    return (x%y + y)%y;
}

void solve();

signed main(){
    
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    //cin>> t;
    while(t--){
        solve();
    }

    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}

const int MAXN = 1e4 + 10;

int n;
vector<int> graph[MAXN], val;
int dp_b[MAXN], dp_w[MAXN];

void solve(int node, int par){
  //  debug(node);
    //debug(par);
    for(auto u : graph[node])
        if(u != par){
            solve(u, node);
            dp_b[node] += dp_b[u];
            dp_w[node] += dp_w[u];
        }
 //   debug(dp_b[node]);
   // debug(dp_w[node]);
    if(min(dp_b[node], dp_w[node]) > val[node]){
        print("IMPOSSIBLE");
        exit(0);
    }
    else{
        if(dp_b[node] <= val[node] and dp_w[node] <= val[node]){
            if(dp_w[node] <= dp_b[node]){
                dp_w[node] = val[node];
            }
            else
                dp_b[node] = val[node];
        }
        else if(dp_w[node] <= val[node])
            dp_w[node] = val[node];
        else
            dp_b[node] = val[node];
    }
}

void solve(){
    cin>> n;
    for(int i = 2; i <= n; i++){
        int u;
        cin>> u;
        graph[u].append(i);
        graph[i].append(u);
    }
    val.resize(n + 1);
    mem(dp_w, 0);
    mem(dp_b, 0);
    for(int i = 1; i <= n; i++)
        cin>> val[i];
    solve(1, 0);
    print("POSSIBLE");
}