import sys
sys.setrecursionlimit(10**6)
n = int(input())
p = list(map(int, input().split()))
p = [-1] + [q-1 for q in p]
c = [[] for _ in range(n)]
for i in range(1, n):
	c[p[i]].append(i)
x = list(map(int, input().split()))
y = [0 for _ in range(n)]

def dfs(cur):
	s = 0
	for v in c[cur]:
		s += dfs(v)
	if s > x[cur]:
		print("IMPOSSIBLE")
		sys.exit()
	y[p[cur]] += x[cur]
	return y[cur]

dfs(0)
print("POSSIBLE")