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

L = [list() for _ in range(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]
  l = L[i]

  x = X[i]
  m = 0
  for a,b in l:
    if b <= x:
      m += a
    elif a <= x:
      m += b
    else:
      print('IMPOSSIBLE')
      exit()
  L[p].append(tuple(sorted((x,m))))
  D[p] -= 1
  if D[p] == 0:
    stack.append(p)

print('POSSIBLE')

