package main
import "fmt"
var tree [][]int
var x []int
func main() {
  var n,p int
  fmt.Scan(&n)
  if n == 1 { fmt.Println("POSSIBLE");return }
  tree = make([][]int,n)
  x = make([]int,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 c,_ := dfs(0);c < 0 {
    fmt.Println("IMPOSSIBLE")
  } else {
    fmt.Println("POSSIBLE")
  }
}
func dfs(v int) (int,int) {
  if len(tree[v]) == 0 { return x[v],0 }
  s := 0
  dp := make([]bool,x[v]+1)
  dp[0] = true
  ok := false
  for _,e := range tree[v] {
    b,w := dfs(e)
    if b < 0 { return -1,-1 }
    if b < w { b,w = w,b }
    if w-1 < x[v] { ok = true }
    s += b+w
    for i:=x[v];i>w-1;i-- {
      if dp[i-w] { dp[i] = true;continue }
      if i > b-1 && dp[i-b] { dp[i] = true }
    }
  }
  if ok {
    for i:=x[v];i>-1;i-- {
      if dp[i] { return x[v],s-i }
    }
  }
  return -1,-1
}