#pragma GCC optimize("O3")

#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

mt19937_64 rnd;

ll INF = 1e9;

int num = 0;

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

void dfs(int v, int hh) {
    if (v == 1 || pred[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;

int calc(int v, int z) {
    int ret = 0;
    if (used[v] == num) {
        ret++;
        for (auto now : g[v]) ret += calc(now, z);
    }
    return ret;
}

int MN;

int 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;
}

int calc3(int u) {
    set<pii> setik;
    setik.insert({s[1], 1});
    int ret = 0;
    while (!setik.empty()) {
        auto [sum, v] = *setik.rbegin();
        setik.erase({sum, v});
        if (v == U) break;
        used[v] = num;
        ret++;
        for (auto now : g[v]) {
            setik.insert({s[now], now});
        }
    }
    return ret;
}

void solve() {
    ll n, q;
    cin >> n >> q;
    g.resize(n + 1);
    s.resize(n + 1);
    pred.resize(n + 1);
    mn_pref.resize(n + 1);
    used.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--) {
        num++;
        int u;
        cin >> u;
        if (u == 1) {
            cout << 0 << "\n";
            continue;
        }
        U = u;
        MN = mn_pref[u];
        int ans = calc3(u);
        int mx = 0;
        //cout << u << " " << mn_pref[u] << "\n";
        while (pred[u] != 0) {
            mx = max(mx, calc2(pred[u], u));
            u = pred[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;
}
