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

int n, q, cnt;
vector<vector<int>> g;
vector<int> s, is;

void dfs(int v, int sv) {
    ++cnt;
    for (auto & u : g[v]) {
        if (s[u] > sv) {
            dfs(u, sv);
        }
    }
}

pair<int, int> dfs_max(int v, int sv, int cv) {
    if (v == cv) return {0, 1};
    int mx = 0, sm = 1, fl = 0;
    for (auto & u : g[v]) {
        if (s[u] >= sv || is[u]) {
            auto [cur_ans, cur_fl] = dfs_max(u, sv, cv);
            if (cur_fl == 1) {
                mx = max(mx, cur_ans);
                sm = -1e15;
                fl = 1;
            } else {
                mx = max(mx, cur_ans);
                sm += cur_ans;
            }
        }
    }
    return {max(mx, sm), fl};
}

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);
    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];
    }
    while (q--) {
        int v; cin >> v; --v;
        cnt = 0;
        is.assign(n, 0);
        dfs(0, s[v]);
        int cur = v;
        while (cur != 0) {
            cnt += s[cur] < s[v];
            is[cur] = 1;
            cur = pr[cur];
        }
        if (v == 0) cnt = 0;
        //cout << cnt << " " << dfs_max(0, s[v], v).first << " | ";
        cout << cnt - dfs_max(0, s[v], v).first << " ";
    }
    return 0;
}

/*

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


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


*/
