local n = io.read("*n")
local p = {0}
for i = 2, n do
  p[i] = io.read("*n")
end
local base = {}
local t = {}
local x = {}
for i = 1, n do
  base[i] = 0
  t[i] = {}
  x[i] = io.read("*n")
end
local valid = true
for i = n, 1, -1 do
  local tgt = x[i] - base[i]
  if tgt < 0 then
    valid = false
    break
  end
  -- get highest value y where dp[y] == true
  local dp = {}
  for j = 1, tgt do
    dp[j] = false
  end
  local sum = base[i]
  for j = 1, #t[i] do
    local tv = t[i][j]
    sum = sum + tv
    for k = tgt - tv, 1, -1 do
      if dp[k] then dp[k + tv] = true end
    end
    if tv <= tgt then dp[tv] = true end
  end
  local r = 0
  for j = tgt, 1, -1 do
    if dp[j] then r = j break end
  end
  if 1 < i then
    local v1 = x[i] -- base[i] + r <= x[i]. "bese[i] + r" became x[i].
    local v2 = sum - base[i] - r
    local parent = p[i]
    if v2 < v1 then v1, v2 = v2, v1 end
    base[parent] = base[parent] + v1
    if v1 < v2 then table.insert(t[parent], v2 - v1) end
  end
end
print(valid and "POSSIBLE" or "IMPOSSIBLE")
