n = int(input())
p = list(map(int,input().split()))
x = list(map(int,input().split()))
g = [[] for i in range(n)]
for i in range(n-1):
  g[p[i]-1].append(i+1)
kyo = [float("inf")] * n
def dfs(x,y):
  kyo[x] = y
  for i in g[x]:
    dfs(i,y+1)
dfs(0,0)
hukai = []
for i in range(n):
  hukai.append([kyo[i],i])
hukai.sort(key = lambda x:-x[0])
omomi = [[0,0] for i in range(n)]
for j,i in hukai:
  if len(g[i]) == 0:
    omomi[i] = [x[i],0]
    continue
  MIN = 0
  MAX = 0
  for k in g[i]:
    MIN += min(omomi[k])
    MAX += max(omomi[k])
  if MIN <= x[i] and x[i] < MAX:
    omomi[i] = [x[i],MAX]
  elif x[i] >= MAX:
    omomi[i] = [x[i],MIN]
  else:
    print("IMPOSSIBLE")
    exit()
print("POSSIBLE")