#include <bits/stdc++.h>

#define int long long
using namespace std;

const int INF = 2e16;

vector<vector<int>> g;
vector<int> s, used, used1;
int mn = INF, k = 0;

void dfs(int u, int mn1, int k1) {
    used[u] = 1;
    if (u == 0) {
        mn = mn1;
        k = k1;
        return;
    }
    mn1 = min(mn1, s[u]);
    k1++;
    for (auto v: g[u]) {
        if (used[v] == 0) {
            if (v == 0) {
                used1[u] = 1;
            }
            dfs(v, mn1, k1);
        }
    }
}

signed main() {
    int n, q;
    cin >> n >> q;
    g.resize(n);
    s.resize(n);
    for (int i = 1; i <= n - 1; i++) {
        int x;
        cin >> x;
        x--;
        g[x].push_back(i);
        g[i].push_back(x);
    }
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    while (q--) {
        int x;
        cin >> x;
        x--;
        if (x == 0) {
            cout << 0;
            continue;
        }
        mn = INF;
        used.assign(n, 0);
        used1.assign(n, 0);
        dfs(x, INF, 0);
        vector<int> all;
        for (auto v: g[0]) {
            if (used1[v] == 1) {
                continue;
            }
            int cnt = 0;
            deque<int> pp;
            pp.push_back(v);
            while (!pp.empty()) {
                int u = pp[0];
                pp.pop_front();
                if (s[u] < mn) {
                    continue;
                }
                cnt++;
                for (auto vv: g[u]) {
                    pp.push_back(vv);
                }
            }
            all.push_back(cnt);
        }
        sort(all.begin(), all.end());
        int ans = 0;
        for (int i = 0; i < (int)all.size() - 1; i++) {
            ans += all[i];
        }
        cout << ans + k - 1;
    }
}