#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <array>
#include <queue>

using namespace std;
typedef int ll;
typedef long double ld;
#define all(a) a.begin(), a.end()
const ll INF = 2e9;
const ll N = 1 << 19;
vector<ll> g[N]{};
ll n, q, p[N]{}, pbig[N], mnbig[N], pd[N], mnd[N], firmn[N]{}, h[N]{}, s[N], sm[N]{}, smp[N]{}, mx1[N]{}, mx2[N]{};
char isd[N]{};
ll seg[2 * N];
void upd(ll x, ll d) {
	seg[N + x] = d;
	for (ll v = (N + x) / 2; v > 0; v /= 2) {
		seg[v] = min(seg[v * 2], seg[v * 2 + 1]);
	}
}

ll get(ll d, ll v = 1, ll l = 0, ll r = N) {
	if (l + 1 == r) return l;
	ll m = (l + r) / 2;
	if (seg[v * 2 + 1] < d) return get(d, v * 2 + 1, m, r);
	return get(d, v * 2, l, m);
}

void first_dfs(ll v, ll stbig, ll mnlast, vector<ll>& st) {
	h[v] = h[p[v]] + 1;
	upd(h[v], s[v]);
	st.push_back(v);
	firmn[v] = st[get(s[v]) + 1];
	mnlast = min(mnlast, s[v]);
	pbig[v] = stbig;
	mnbig[v] = mnlast;
	for (ll u : g[v]) {
		if (g[v].size() >= 2)
			first_dfs(u, u, N, st);
		else
			first_dfs(u, stbig, mnlast, st);
	}
	upd(h[v], N);
	st.pop_back();
}

void second_dfs(ll v, ll stbig, ll mnlast) {
	mnlast = min(mnlast, s[v]);
	pd[v] = stbig;
	mnd[v] = mnlast;
	for (ll u : g[v]) {
		if (isd[v])
			second_dfs(u, u, N);
		else
			second_dfs(u, stbig, mnlast);
	}
}
ll nap[N];
ll calc(ll v, ll& res, ll& mx) {
	res++;
	ll smv = 1;
	for (ll u : g[v]) {
		if (nap[u] >= 0) calc(u, res, mx);
		else if (s[u] > nap[v]) {
			nap[u] = nap[v];
			ll smu = calc(u, res, mx);
			mx = max(mx, smu);
			smv += smu;
		}
	}
	return smv;
}
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> q;
	p[1] = 0, h[0] = 0;
	for (ll i = 2; i <= n; i++) {
		cin >> p[i];
		g[p[i]].push_back(i);
	}
	for (ll i = 1; i <= n; i++) cin >> s[i];
	vector<ll> ans(q);
	for (ll j = 0; j < q; j++) {
		ll v;
		cin >> v;
		fill(nap, nap + n + 1, -1);
		ll mn = s[v];
		while (v > 1) {
			nap[p[v]] = mn;
			v = p[v];
			mn = min(mn, s[v]);
		}
		ll res = 0, mx = 0;
		if (nap[1] >= 0) {
			calc(1, res, mx);
		}
		ans[j] = res - mx;
	}
	for (ll x : ans) cout << x << " ";
	cout << "\n";
	return 0;
}