package main

import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
  "sort"
)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntVec(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatVec(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}

type Items [][]int
func (I Items) Len() int { return len(I) }
func (I Items) Less(i, j int) bool {
  if I[i][0] == I[j][0] { return I[i][1] < I[j][1] }
  return I[i][0] < I[j][0]
}
func (I Items) Swap(i, j int) { I[i], I[j] = I[j], I[i] }

func Solve() {
  var N int
  NextInt(&N)
  var P, X []int
  NextIntVec(&P)
  NextIntVec(&X)
  T := make([][]int, N)
  C := make([][][]int, N)
  for i := range T {
    T[i] = make([]int, 2)
    C[i] = make([][]int, 0)
  }
  ans := "POSSIBLE"
  for i := N - 1; 0 <= i; i-- {
    sort.Sort(Items(C[i]))
    for _, c := range C[i] {
      if T[i][0] <= X[i] { break }
      d := c[1] - c[0]
      T[i][0] += d
      T[i][1] -= d
    }
    if X[i] < T[i][0] {
      ans = "IMPOSSIBLE"
      break
    }
    T[i][0] = X[i]
    if i == 0 { break }
    if T[i][0] < T[i][1] { T[i][0], T[i][1] = T[i][1], T[i][0] }
    p := P[i - 1] - 1
    C[p] = append(C[p], T[i])
    T[p][0] += T[i][0]
    T[p][1] += T[i][1]
  }
  Write(ans)
  return
}

func main() {
  Solve()
  Output()
}