
from itertools import chain

N = int(input())

P = list(chain((0,), map(lambda x: int(x)-1,input().split())))
X = list(map(int,input().split()))

dp = [0]*N

# 葉ノード探索
D = [0]*N
for p in P:
  D[p] += 1
D[0] -= 1
stack = [i for i,t in enumerate(D) if t==0]


while stack:
  i = stack.pop()
  p = P[i]

  a,b = sorted((X[i],dp[i]))

  xp = X[p]

  if b <= xp:
    dp[p] += a
  elif a <= xp:
    dp[p] += b
  else:
    print('IMPOSSIBLE')
    exit()

  D[p] -= 1
  if D[p] == 0:
    stack.append(p)

print('POSSIBLE')