#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define all(vec) vec.begin(), vec.end()
#define pii pair<int, int>
#define pll pair<ll, ll>
#define fi first
#define se second
#define int ll

mt19937_64 rnd;

ll INF = 1e9;

vector<vector<int>> g;
vector<int> pred;
vector<int> h;
vector<int> s;
vector<int> mn_pref;

void dfs(int v, int hh) {
    h[v] = hh;
    if (v == 1) {
        mn_pref[v] = s[v];
    } else {
        mn_pref[v] = min(mn_pref[pred[v]], s[v]);
    }
    for (auto now : g[v]) {
        dfs(now, hh + 1);
    }
}

int U;

ll calc(int v, int z) {
    if (v == U) return 0;
    ll ret = 0;
    if (s[v] >= z) {
        ret++;
        for (auto now : g[v]) ret += calc(now, z);
    }
    return ret;
}

ll MN;

ll calc2(int v, int net) {
    int mx = 0;

    for (auto now : g[v]) {
        if (now == net) continue;
        int cl = calc(now, MN);
        mx = max(mx, cl);
    }

    return mx;
}

void solve() {
    ll n, q;
    cin >> n >> q;
    g.resize(n + 1);
    h.resize(n + 1);
    s.resize(n + 1);
    pred.resize(n + 1);
    mn_pref.resize(n + 1);
    for (int i = 2; i <= n; i++) {
        int p;
        cin >> p;
        pred[i] = p;
        g[p].push_back(i);
    }
    for (int i = 1; i <= n; i++) cin >> s[i];

    dfs(1, 0);
    while (q--) {
        ll u;
        cin >> u;
        U = u;
        MN = mn_pref[u];
        ll ans = calc(1, mn_pref[u]);
        ll mx = 0;
        while (pred[u] != 0) {
            mx = max(mx, calc2(pred[u], u));
            u = pred[u];
            U = u;
        }
        //cout << ans << " " << mx << "\n";
        cout << ans - mx << "\n";
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
