package main
import "fmt"
var tree [][]int
var x []int64
func main() {
  var n,p int
  fmt.Scan(&n)
  if n == 1 { fmt.Println("POSSIBLE");return }
  tree = make([][]int,n)
  x = make([]int64,n)
  for i:=1;i<n;i++ {
    fmt.Scan(&p)
    tree[p-1] = append(tree[p-1],i)
  }
  for i:=0;i<n;i++ { fmt.Scan(&x[i]) }
  if dfs(0) < 0 {
    fmt.Println("IMPOSSIBLE")
  } else {
    fmt.Println("POSSIBLE")
  }
}
func dfs(v int) int64 {
  if len(tree[v]) == 0 { return 0 }
  s := int64(0)
  dp := make([]bool,x[v]+1)
  dp[0] = true
  zero := true
  for _,e := range tree[v] {
    y := dfs(e)
    if y < 0 { return -1 }
    z := x[e]
    if y > z { y,z = z,y }
    if y > 0 { zero = false }
    s += y+z
    for i:=x[v];i>y-1;i-- {
      if dp[i-y] { dp[i] = true;continue }
      if i > z-1 && dp[i-z] { dp[i] = true }
    }
  }
  dp[0] = zero
  for i:=x[v];i>-1;i-- {
    if dp[i] { return s-int64(i) }
  }
  return -1
}