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))

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

    return min(B)

dfs(1)
print('POSSIBLE')