
#include <iostream>
#include <limits>
#include <chrono>
#include <random>
#include <iomanip>
#include <algorithm>
#include <chrono>
#include <random>
#include <math.h>
#include <set>
using namespace std;
#define int long long
const int maxn = 3e5+1;
int t = 0;
int tin[maxn], tout[maxn],min_v[maxn];
vector <int> g[maxn];
void dfs(int u, int min_val,vector <int> &weight) {
	tin[u] = t++;
	int val = min(min_val, weight[u]);
	min_v[u] = val;
	for (auto el : g[u]) {
		dfs(el, val, weight);
	}
	tout[u] = t;
}
void dfs1(int u, int min_val, vector <int>& dp,vector <int> & color,int last,int min_vl,vector <int> &w) {
	if (u == last)return;
	int val = min_vl;
	if (color[u] != 2) {
		val = min(val, w[u]);
	}
	if (val >= min_val || color[u] == 2)dp[u]++;
	for (auto el : g[u]) {
		dfs1(el, min_val, dp,color, last,val,w);
		dp[u] += dp[el];
	}
}
signed main()
{
	int n, q;
	cin >> n >> q;
	vector <int> p(n, -1);
	for (int i = 1;i < n;i++) {
		int pi;
		cin >> pi;
		pi--;
		p[i] = pi;
		g[pi].push_back(i);
	}
	vector <int> w(n);
	for (int i = 0;i < n;i++) {
		cin >> w[i];
	}
	dfs(0, w[0], w);
	vector <int> ans;
	while (q--) {
		int vert;	
		cin >> vert;
		vert--;
		int vert1 = vert;
		vector <int> color(n, 0);
		while (vert1 != -1) {
			color[vert1] = 2;
			vert1 = p[vert1];
		}
		vector <int> dp(n);
		dfs1(0, w[vert], dp, color, vert,1e10,w);
		int pos_now = dp[0];
		int mv = 0;
		for (int i = 0;i < n;i++) {
			if (color[i] != 2) {
				mv = max(mv, dp[i]);
			}
		}
		cout << pos_now - mv << "\n";
	}
}
