#include <bits/stdc++.h>
using namespace std;
#define int long long

int n, q;
vector<vector<int>> g;
vector<int> s, dp, is, tin, tout;

bool anc(int v, int u) {
    return tin[v] <= tin[u] && tout[v] >= tout[u];
}

int t = 1;
void pre(int v) {
    tin[v] = t++;
    for (auto & u : g[v]) {
        pre(u);
    }
    tout[v] = t++;
}

void bfs(vector<int> st, int sv) {
    queue<int> q;
    for (auto & it : st) q.push(it);
    while ((int)q.size()) {
        int v = q.front();
        q.pop();
        is[v] = 1;
        for (auto & u : g[v]) {
            if (s[u] > sv && !is[u]) {
                q.push(u);
            }
        }
    }
}

void dfs_max(int v, int sv, int cv) {
    if (v == cv) return;
    int sm = 1;
    for (auto & u : g[v]) {
        if (is[u]) {
            dfs_max(u, sv, cv);
            dp[v] = max(dp[v], dp[u]);
            sm += dp[u];
        }
    }
    if (!anc(v, cv)) dp[v] = max(dp[v], sm);
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> n >> q;
    g.resize(n);
    s.resize(n);
    is.resize(n);
    tin.resize(n);
    tout.resize(n);
    vector<int> pr(n);
    for (int i = 1; i < n; ++i) {
        int p; cin >> p; --p;
        g[p].push_back(i);
        pr[i] = p;
    }
    for (int i = 0; i < n; ++i) {
        cin >> s[i];
    }
    pre(0);
    while (q--) {
        int v; cin >> v; --v;
        is.assign(n, 0);
        dp.assign(n, 0);
        vector<int> st;
        is[v] = 1;
        int cur = v, sv = s[v];
        st.push_back(0);
        while (cur != 0) {
            st.push_back(cur);
            is[cur] = 1;
            sv = min(sv, s[cur]);
            cur = pr[cur];
        }
        bfs(st, sv);
        int cnt = 0;
        for (int i = 0; i < n; ++i) {
            cnt += is[i];
        }
        if (v == 0) cnt = 1;
        dfs_max(0, sv, v);
        //cout << cnt << " " << dp[0] << " | ";
        cout << cnt - dp[0] - 1 << " ";
    }
    return 0;
}

/*

5 4
1 2 2 1
3 5 1 2 4
5 3 1 4


11 1
1 2 3 4 1 6 7 8 6 10
10 9 8 7 6 11 12 13 14 1 100
11


*/
