use proconio::input;
// dbg {{{
#[allow(dead_code)]
mod dbg {
    use std::fmt::{Debug, Formatter};

    #[derive(Clone)]
    pub struct Tabular<'a, T: Debug>(pub &'a [Vec<T>]);

    impl<'a, T: Debug> Debug for Tabular<'a, T> {
        fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
            for i in 0..self.0.len() {
                writeln!(f, "{:2} | {:?}", i, &self.0[i])?;
            }
            Ok(())
        }
    }
}
// }}}

fn main() {
    input!(
        n: usize,
        p: [proconio::marker::Usize1; n - 1],
        a: [usize; n]
    );
    let mut g = vec![vec![]; n];
    for (i, x) in p.iter().enumerate().map(|(i, &x)| (i + 1, x)) {
        g[x].push(i);
    }
    let mut dp = vec![std::usize::MAX; n];
    fn dfs(x: usize, dp: &mut [usize], g: &[Vec<usize>], a: &[usize]) {
        for &y in &g[x] {
            dfs(y, dp, g, a);
        }
        let mut table = vec![false; a[x] + 1];
        table[0] = true;
        for (w0, w1) in g[x].iter().copied().map(|y| (a[y], dp[y])) {
            for i in (0..=a[x]).rev() {
                for w in [w0, w1].iter() {
                    if i + w <= a[x] {
                        table[i + w] |= table[i];
                    }
                    if w0 != 0 && w1 != 0 {
                        table[i] = false;
                    }
                }
            }
        }
        if let Some(z) = (0..=a[x]).rfind(|&w| table[w]) {
            dp[x] = g[x].iter().map(|&y| a[y]).sum::<usize>() - z;
        } else {
            println!("IMPOSSIBLE");
            std::process::exit(0);
        }
    }
    dfs(0, &mut dp, &g, &a);
    println!("POSSIBLE");
}
