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

#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")


const int N = 3e5;
vector<vector<int>> g(N);
vector<int> s(N), sz(N), p(N), help(N), used(N);

void calc(int v) {
    sz[v] = 1;
    for (auto x : g[v]) {
        calc(x);
        sz[v] += sz[x];
    }
}

int sum_sz = 0, mx_r = 0;
int ans = 1e9;

void dfs(int v, int val) {
    help[v] = 0;
    for (auto x : g[v]) {
        if (s[x] <= val && !used[x]) {
            sum_sz += sz[x];
            help[x] = sz[x];
            help[v] += help[x];
            continue;
        }
        dfs(x, val);
        help[v] += help[x];
    }
    if (!used[v]) {
        // cout << v + 1 << " : " << help[v] << endl;
        mx_r = max(mx_r, sz[v] - help[v]);
    }
}




inline void solve(int n, int v) {
    int x = p[v];
    while (x != -1) {
        used[x] = 1;
        x = p[x];
    }
    sum_sz = 0;
    ans = 1e9;
    mx_r = 0;
    dfs(0, s[v]);
    ans = sum_sz + mx_r;
    x = p[v];
    while (x != -1) {
        used[x] = 0;
        x = p[x];
    }
    cout << n - ans << '\n';
}


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef FILE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, q;
    cin >> n >> q;
    p[0] = -1;
    for (int i = 1; i < n; ++i) {
        cin >> p[i];
        p[i]--;
        g[p[i]].push_back(i);
    }
    calc(0);
    for (int i = 0; i < n; ++i) cin >> s[i];
    while (q--) {
        int v; cin >> v; v--;
        solve(n, v);
    }
}