#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <random>
#include <deque>
#include <stack>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;
using ld = long double;
using str = string;

//mt19937 rnd(288);

const int INF = 1e9 + 239;
const int EPS = 1e-9;

void fastw() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
}

const int MAXN = 3e5 + 239;
vector<vector<int>> g(MAXN);
vector<int> p(MAXN);
vector<int> s(MAXN);

vector<int> ans(MAXN);
vector<bool> used(MAXN, false);
vector<int> cnt(MAXN, 0);

void dfs(int v, int k) {
	used[v] = true;
	cnt[v] = 1;
	for (int u : g[v]) {
		if (!used[u] && s[u] > k) {
			dfs(u, k);
		}
		cnt[v] += cnt[u];
	}
}

void solve() {
	int n, q;
	cin >> n >> q;
	p[1] = 0;
	for (int i = 2; i <= n; i++) {
		cin >> p[i];
		g[p[i]].push_back(i);
	}
	for (int i = 1; i <= n; i++) {
		cin >> s[i];
	}
	vector<pair<int, int>> a(n);
	for (int i = 1; i <= n; i++) {
		a[i - 1] = { s[i], i };
	}
	sort(a.begin(), a.end());
	reverse(a.begin(), a.end());
	int now = 0;
	for (int i = 0; i < n; i++) {
		int v = a[i].second;
		if (v == 1) {
			ans[v] = 0;
			used[v] = true;
		}
		else {
			if (!used[v]) {
				int last = 0;
				int pos = v;
				cnt[v] = 1;
				used[v] = true;
				int k = s[v];
				v = p[v];
				while (!used[v] && v != 0) {
					last = cnt[pos];
					dfs(v, k);
					k = min(k, s[v]);
					pos = v;
					v = p[v];
				}
				while (v != 0) {
					cnt[v] = cnt[v] - last + cnt[pos];
					v = p[v];
				}
			}
			ans[a[i].second] = cnt[1] - cnt[a[i].second];
			v = a[i].second;
			int son = v;
			v = p[v];
			while (v != 0) {
				for (int u : g[v]) {
					if (u != son) {
						ans[a[i].second] = min(ans[a[i].second], cnt[1] - cnt[a[i].second] - cnt[u]);
					}
				}
				son = v;
				v = p[v];
			}
		}
	}
	while (q--) {
		int v;
		cin >> v;
		cout << ans[v] << ' ';
	}
}

int main() {
	fastw();
	int tt = 1;
	//cin >> tt;
	while (tt--) {
		solve();
		cout << '\n';
	}
}