#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
using ll = long long;
using ld = long double;
const int INF = 1e9;

vector<vector<int>> g;
vector<int> s;
vector<int> a, dp;
vector<int> posl;

void dfs(int u, int p, int que, int i) {
	if (u == que) return;
	if (u == 0 || s[u] > posl[i]) {
		a[u] = 1;
	}
	else {
		while (i < posl.size() && s[u] < posl[i]) {
			i++;
		}
		if (i < posl.size())
			a[u] = 1;
	}
	dp[u] = a[u];
	if (u != que && a[u] == 1) {
		for (int v : g[u]) {
			if (v != p) {
				dfs(v, u, que, i);
				dp[u] += dp[v];
			}
		}
	}
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n, q;
	cin >> n >> q;
	g.resize(n);
	vector<int> p(n, -1);
	for (int i = 1; i < n; ++i) {
		cin >> p[i];
		p[i]--;
		g[i].push_back(p[i]);
		g[p[i]].push_back(i);
	}
	s.resize(n);
	for (int i = 0; i < n; ++i)
		cin >> s[i];
	for (int _ = 0; _ < q; ++_) {
		int u; cin >> u; u--;
		vector<bool> pred(n, false);
		int v = u;
		posl.clear();
		while (v != -1) {
			posl.push_back(s[v]);
			pred[v] = true;
			v = p[v];
		}
		reverse(posl.begin(), posl.end());
		a.assign(n, 0);
		dp.assign(n, 0);
		dfs(0, -1, u, 0);
		int ans = dp[0];
		for (int v = 1; v < n; ++v) {
			if (!pred[v])
				ans = min(ans, dp[0] - dp[v]);
		}
		cout << ans << " ";
	}

	return 0;
}