#include <bits/stdc++.h>

using namespace std;

vector<vector<int>> g;
vector<int> a;
vector<vector<pair<int, int>>> vals;
vector<vector<tuple<short, short, short>>> qs;
vector<int> ansval, ansbest;

void dfs(int v) {
    vector<tuple<int, int, int>> va;
    for (auto to : g[v]) {
        dfs(to);
        for (auto& [k, val] : vals[to])
            va.push_back({ min(k, a[to]), to, val });
        va.push_back({ a[to], to, 1 });
        vals[to].clear();
    }
    sort(va.begin(), va.end());
    set<pair<int, int>> se;
    map<int, int> counts;
    sort(qs[v].begin(), qs[v].end());
    int qptr = qs[v].size() - 1;
    int tot = 0;
    if (va.size() == 0)
        return;
    int begt = get<0>(va.back());
    while (qptr >= 0 && get<0>(qs[v][qptr]) > begt)
        qptr -= 1;
    for (int i = va.size() - 1; i >= 0;) {
        int curt = get<0>(va[i]);
        int curcnt = 0;
        while (i >= 0 && get<0>(va[i]) == curt) {
            auto [t, to, val] = va[i];
            se.erase({ counts[to], to });
            counts[to] += val;
            se.insert({ counts[to], to });
            curcnt += val;
            --i;
        }
        tot += curcnt;
        vals[v].push_back({ curt, curcnt });
        int prevt = (i >= 0 ? get<0>(va[i]) : -1ll);
        while (qptr >= 0 && get<0>(qs[v][qptr]) <= curt && get<0>(qs[v][qptr]) > prevt) {
            auto [qt, qid, qto] = qs[v][qptr];
            ansval[qid] += tot - counts[qto];
            if (se.rbegin()->second != qto)
                ansbest[qid] = max(ansbest[qid], se.rbegin()->first);
            else if (se.size() > 1 && se.rbegin()->second == qto)
                ansbest[qid] = max(ansbest[qid], next(se.rbegin())->first);
            --qptr;
        }
    }
    qs[v].clear();
}

signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int n, q;
    cin >> n >> q;
    g.resize(n);
    vector<int> p(n);
    p[0] = -1;
    for (int i = 1; i < n; ++i) {
        int pi;
        cin >> pi;
        --pi;
        g[pi].push_back(i);
        p[i] = pi;
    }
    a.resize(n);
    for (auto& el : a)
        cin >> el;
    qs.resize(n), vals.resize(n), ansval.resize(q), ansbest.resize(q);
    for (int qid = 0; qid < q; ++qid) {
        int v;
        cin >> v;
        --v;
        int cur = a[v];
        int curv = p[v];
        int prv = v;
        while (curv != -1) {
            ansval[qid] += 1;
            qs[curv].push_back({ cur, qid, prv });
            cur = min(cur, a[curv]);
            prv = curv;
            curv = p[curv];
        }
    }
    dfs(0);
    for (int qid = 0; qid < q; ++qid)
        cout << ansval[qid] - ansbest[qid] << ' ';
    // while (q--) {
    //     int v;
    //     cin >> v;
    //     --v;
    //     int cur = a[v];
    //     int curv = p[v];
    //     int prv = v;
    //     int ans = 0, best = 0;
    //     while (curv != -1) {
    //         ans += 1;
    //         for (auto to : g[curv]) {
    //             if (to == prv)
    //                 continue;
    //         }
    //         prv = curv;
    //         curv = p[curv];
    //     }
    //     cout << ans - best << ' ';
    // }
}