import sys
N=int(input())
plist=list(map(int,input().split()))
xlist=[0]+list(map(int,input().split()))

def dfs(u):
  if not graph[u]:
    return (xlist[u],0)
  
  ret=[]
  for v in graph[u]:
    ret.append(dfs(v))
    
  left_sum=right_sum=0
  for r in ret:
    if left_sum+r[0]<=xlist[u] and right_sum+r[1]<=xlist[u]:
      left_sum+=r[0]
      right_sum+=r[1]
    elif left_sum+r[1]<=xlist[u] and right_sum+r[0]<=xlist[u]:
      left_sum+=r[1]
      right_sum+=r[0]
    else:
      print("IMPOSSIBLE")
      sys.exit(0)
    
  #print(u,left_sum,right_sum)
  if left_sum<right_sum:
    return (left_sum,xlist[u])
  else:
    return (xlist[u],right_sum)

graph=[[] for _ in range(N+1)]
for i in range(N-1):
  p=plist[i]
  graph[p].append(i+2)
#print(graph)
#print(xlist)

result=dfs(1)
#print(result)
if min(result)<=xlist[1]:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")