#include<bits/stdc++.h>
using namespace std;

#define INF 100009

int N;
int P[1010],X[1010];
int dp[1010][5010] = {0};
bool F = false;

int main()
{
    scanf("%d",&N);
    for(int i = 2; i <= N; i++)scanf("%d",P + i);
    for(int i = 1; i <= N; i++)scanf("%d",X + i);

    for(int i = N; i > 0; i--)
    {
        int MIN = INF;
        for(int j = 0; j <= X[i]; j++)MIN = min(MIN,dp[i][j]);
        if(MIN == INF)F = true;

        int par = P[i];

        for(int j = X[par]; j >= 0; j--)
        {
            int cost = INF;
            if(j >= MIN)cost = dp[par][j - MIN] + X[i];
            if(j >= X[i])cost = min(cost,dp[par][j - X[i]] + MIN);
            dp[par][j] = cost;
        }
    }


    if(F)printf("IMPOSSIBLE\n");
    else printf("POSSIBLE\n");

    return 0;
}
