#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<bool> used(MAXN, false);

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

vector<int> cnt(MAXN, 0);

void dfs_cnt(int v) {
	if (used[v]) {
		cnt[v] = 1;
		for (int u : g[v]) {
			dfs_cnt(u);
			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];
	}
	while (q--) {
		int v;
		cin >> v;
		int v1 = v;
		int k = s[v];
		used[v] = true;
		v = p[v];
		while (v != 0) {
			dfs(v, k);
			k = min(k, s[v]);
			v = p[v];
		}
		dfs_cnt(1);
		v = p[v1];
		int pr = v;
		int mn = 0;
		while (v != 0) {
			for (int u : g[v]) {
				if (used[u] && u != pr) {
					mn = max(mn, cnt[u]);
				}
			}
			pr = v;
			v = p[v];
		}
		if (mn == 0) {
			int v = p[v1];
			while (v != 1) {
				if (g[v].size() == 1) {
					mn = 1;
				}
			}
			v = p[v];
		}
		cout << cnt[1] - mn - 1 << ' ';
		for (int i = 1; i <= n; i++) {
			cnt[i] = 0;
			used[i] = false;
		}
	}
}

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