#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
#include<boost/math/common_factor.hpp>

namespace adaptor = boost::adaptors;

boost::optional<int> check(int n, int N, std::vector<std::vector<int>>const& child, std::vector<int>const& weight)
{
	int min = 0;
	int sum = 0;
	for (auto c : child[n])
	{
		auto another = check(c, N, child, weight);
		if (!another)
		{
			return boost::none;
		}
		min = std::min(*another, weight[c]);
		sum += weight[c] + *another;
	}
	if (min > weight[n])
	{
		return boost::none;
	}
	sum += weight[n] - min;
	return sum - weight[n];
}

void Main()
{
	int N;
	std::cin >> N;
	std::vector<std::vector<int>> child(N);
	std::vector<int> weight(N);
	for (int i : boost::irange(1, N))
	{
		int c;
		std::cin >> c;
		child[c - 1].emplace_back(i);
	}
	for (auto& w : weight)
	{
		std::cin >> w;
	}
	if (check(0, N, child, weight))
	{
		std::cout << "POSSIBLE" << std::endl;
	}
	else
	{
		std::cout << "IMPOSSIBLE" << std::endl;
	}
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}
