#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <climits>
#include <time.h>
#include <cmath>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx2")

using namespace std;
using ll = long long;
using ld = long double;
ll inf = 4e18;

random_device rd;
mt19937 gen(rd());
uniform_int_distribution <> distr(0, INT_MAX);

vector<vector<int>> g, cntmore;
vector<int> s, par, depth;

int n;

void dfs(int v, int d) {
	depth[v] = d;
	for (auto i : g[v]) {
		if (depth[i] == -1) {
			dfs(i, d + 1);
		}
	}
}

int cntm(int v, int m) {
	if (s[v] <= m)
		return 0;
	int ans = 1;
	for (auto i : g[v]) {
		if (i != par[v])
			ans += cntm(i, m);
	}
	return ans;
}

int getans(int v) {
	int S = s[v];
	int sub = 0;
	int ans = 0;
	while (v != 0) {
		int ch = v;
		S = min(S, s[ch]);
		v = par[v];
		ans++;
		for (auto i : g[v]) {
			if (i != par[v] && i != ch) {
				int cur = cntm(i, S);
				ans += cur;
				sub = max(sub, cur);
			}
		}
	}
	return ans - sub;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	int q;
	cin >> q;
	g.resize(n);
	//cntmore.assign(n, vector<int>(n + 1, 0));
	par.assign(n, -1);
	depth.assign(n, -1);
	s.resize(n);
	for (int i = 1; i < n; i++) {
		cin >> par[i];
		par[i]--;
		g[i].push_back(par[i]);
		g[par[i]].push_back(i);
	}
	for (int i = 0; i < n; i++)
		cin >> s[i];
	dfs(0, 0);
	while (q--) {
		int x;
		cin >> x;
		cout << getans(x - 1) << " ";
	}
}