use io::*;

fn main() {
    let input = read_string();
    let mut sc = Scanner::new(&input);
    let n: usize = sc.next();
    if n == 1 {
        println!("POSSIBLE");
        return;
    }
    let mut nodes: Vec<Vec<usize>> = vec![Vec::new();n];
    for i in 1..n {
        let p: usize = sc.next();
        nodes[p-1].push(i);
    }
    let xs = sc.next_vec::<usize>(n);
    let mut q: Vec<[usize;3]> = vec![[xs[0],usize::max_value(),0]];
    loop {
        if q.is_empty() {
            break;
        }
        let s = q.pop().unwrap();
        let mut a = s[0];
        let mut b = s[1];
        let i = s[2];
        for v in nodes[i].clone() {
            if xs[v] > b {
                println!("IMPOSSIBLE");
                return;
            } else if xs[v] <= a {
                a -= xs[v];
                q.push([xs[v],b,v]);
            } else {
                b -= xs[v];
                q.push([a,xs[v],v]);
            }
        }
    }
    println!("POSSIBLE");
}

pub mod io {
    use std;
    use std::str::FromStr;

    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T: FromStr>(&mut self) -> T {
            let s = self.iter.next().unwrap();
            if let Ok(v) = s.parse::<T>() {
                v
            } else {
                panic!("Parse error")
            }
        }

        pub fn next_vec_len<T: FromStr>(&mut self) -> Vec<T> {
            let n: usize = self.next();
            self.next_vec(n)
        }

        pub fn next_vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }

        pub fn next_mat<T: FromStr>(&mut self, w: usize, h: usize) -> Vec<Vec<T>> {
            (0..h).map(|_| self.next_vec(w)).collect()
        }

        pub fn next_vec_char(&mut self) -> Vec<char> {
            self.next::<String>().chars().collect()
        }

        pub fn next_mat_char(&mut self, n: usize) -> Vec<Vec<char>> {
            (0..n).map(|_| self.next_vec_char()).collect()
        }
    }

    pub fn read_string() -> String {
        use std::io::Read;

        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }

    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}
