#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;
const int sz = 3 * 1e5;

int a[sz], dp[sz], s[sz], p[sz];
int maxdp = 0;
bool pred[sz];
vector<int> g[sz];
int posl[sz], pref[sz];

void dfs(int u, int p, int que, int i) {
	a[u] = 0; dp[u] = 0;
	if (u == que) return;
	if (u == 0 || (i >= 0 && s[u] > pref[i])) {
		a[u] = 1;
	}
	else if (i >= 0 && pred[u]) {
		a[u] = 1;
		i--;
	}
	dp[u] = a[u];
	if (a[u] == 1) {
		for (int v : g[u]) {
			if (v != p) {
				dfs(v, u, que, i);
				dp[u] += dp[v];
			}
		}
	}
	if (u != 0 && !pred[u])
		maxdp = max(maxdp, dp[u]);
}

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

	int n, q;
	cin >> n >> q;
	p[0] = -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);
	}
	for (int i = 0; i < n; ++i) {
		cin >> s[i];
		pred[i] = false;
	}
	for (int _ = 0; _ < q; ++_) {
		int u; cin >> u; u--;
		if (u == 0) {
			cout << 0 << " ";
			continue;
		}
		int v = u;
		int i = 0;
		while (v != 0) {
			posl[i] = s[v];
			if (i != 0)
				pref[i] = min(pref[i - 1], s[v]);
			else
				pref[i] = s[v];
			i++;
			pred[v] = true;
			v = p[v];
		}
		maxdp = 0;
		dfs(0, -1, u, i - 1);
		int ans = dp[0] - maxdp;
		v = u;
		while (v != 0) {
			pred[v] = false;
			v = p[v];
		}
		cout << ans << " ";
	}

	return 0;
}