#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

int cnt(int v, int x, vector<vector<int>>& tree, vector<int>& s) {
    if (s[v]<=x) return 0;
    int ans = 1;
    for (auto u : tree[v]) ans += cnt(u, x, tree, s);
    return ans;
}

pair<int, int> getAns(int v, int mi, vector<int>& pred, vector<vector<int>>& tree, vector<int>& s) {
    if (v==0) return {0, 0};
    mi = min(mi, s[v]);
    pair<int, int> ans = {1, 0};
    for (auto u : tree[pred[v]]) {
        if (u==v) continue;
        int c = cnt(u, mi, tree, s);
        ans.first+=c;
        ans.second = max(ans.second, c);
    }
    pair<int, int> a = getAns(pred[v], mi, pred, tree, s);
    ans.first += a.first;
    ans.second = max(ans.second, a.second);
    return ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int n, q; cin >> n >> q;
    vector<int> pred(n);
    vector<vector<int>> tree(n);
    for (int i = 1; i < n; ++i) {
        cin >> pred[i]; --pred[i];
        tree[pred[i]].emplace_back(i);
    }
    vector<int> s(n);
    for (int i = 0; i < n; ++i) cin >> s[i];
    while (q--) {
        int v; cin >> v; --v;
        pair<int, int> ans = getAns(v, n, pred, tree, s);
        cout << ans.first-ans.second << ' ';
    }
    cout << '\n';

    return 0;
}
