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

using namespace std;

int get(int x, vector<int>& vec) {
    int L = -1, R = vec.size();
    while (R-L > 1) {
        int M = (L+R)/2;
        if (vec[M]<x) L = M;
        else R = M;
    }
    return vec.size()-R;
}

pair<int, int> getAns(int v, int mi, vector<int>& pred, vector<vector<int>>& tree, vector<int>& s, vector<vector<int>>& vec) {
    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 = get(mi, vec[u]);
        ans.first+=c;
        ans.second = max(ans.second, c);
    }
    pair<int, int> a = getAns(pred[v], mi, pred, tree, s, vec);
    ans.first += a.first;
    ans.second = max(ans.second, a.second);
    return ans;
}

void dfs(int v, vector<vector<int>>& tree, vector<int>& s, vector<vector<int>>& vec) {
    vec[v].emplace_back(s[v]);
    for (auto u : tree[v]) {
        dfs(u, tree, s, vec);
        for (auto i : vec[u]) vec[v].emplace_back(min(i, s[v]));
    }
    sort(vec[v].begin(), vec[v].end());
}

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]; --s[i];}
    vector<vector<int>> vec(n);
    dfs(0, tree, s, vec);
    while (q--) {
        int v; cin >> v; --v;
        pair<int, int> ans = getAns(v, n, pred, tree, s, vec);
        cout << ans.first-ans.second << ' ';
    }
    cout << '\n';

    return 0;
}
