from itertools import product

n = int(input())
P = [0, 0] + [int(i) for i in input().split()]
X = [0] + [int(i) for i in input().split()]

C = [[] for i in range (n+1)]

for i, p in enumerate(P):
    C[p].append(i)

def dfs(i):
    if not C[i]:
        return X[i], 0

    A = []
    
    for c in C[i]:
        A.append(dfs(c))

    S = 0
    for a in A:
        S += sum(a)

    B = []
    for bits in range(2**(len(A))):
        a = 0
        for j, c in enumerate(A):
            a += c[bits >> j & 1]
            if a > X[i]:
                break
        if a <= X[i]:
            B.append(a)
    if not B:
        print('IMPOSSIBLE')
        exit()

    return X[i], S - max(B)

dfs(1)
print('POSSIBLE')