#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> sz(MAXN, 0);

void dfs_sz(int v) {
	sz[v] = 1;
	for (int u : g[v]) {
		dfs_sz(u);
		sz[v] += sz[u];
	}
}

vector<bool> used(MAXN, false);
vector<bool> can(MAXN, true);

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

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