# -*- coding: utf-8 -*-


def mostProperComb(childs, x):
    if sum([c[1] for c in childs]) > x:
        print("IMPOSSIBLE")
        exit()
    loop = 2**len(childs)
    max_a, min_b = 0, 0
    for i in range(loop):
        a, b = 0, 0
        code = bin(loop-i-1)[2:].zfill(len(childs))
        for j, color in enumerate(code):
            if color == '1':
                a += childs[j][1]
                b += childs[j][0]
            elif color == '0':
                a += childs[j][0]
                b += childs[j][1]
        if a >= max_a and x >= a:
            max_a, min_b = a, b
            if max_a == x:
                break

    return (max([x, min_b]), min([x, min_b]))


n = int(input())

p_list = [0] + list(map(int, input().split()))
x_list = list(map(int, input().split()))
c_list = [[] for i in range(n)]

if n == 1:
  print("POSSIBLE")
  exit()

for i in range(n):
    index = n-1-i

    if len(c_list[index]) == 0:
        c_list[index] = (x_list[index], 0)
        c_list[p_list[index]-1].append(index)
    else:
        childs = [c_list[child_index] for child_index in c_list[index]]
        c_list[index] = mostProperComb(childs, x_list[index])
        if not p_list[index] == 0:
            c_list[p_list[index]-1].append(index)

print("POSSIBLE")
