#include <bits/stdc++.h>
#define int long long

using namespace std;

const int INF = 1e18;

vector<vector<int>> g;
vector<int> a;

int calc(int v, int curmin, int bord) {
    curmin = min(curmin, a[v]);
    int curans = 1;
    if (curmin < bord)
        return 0ll;
    for (auto to : g[v])
        curans += calc(to, curmin, bord);
    return curans;
}

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;
    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;
                int tmp = calc(to, INF, cur);
                best = max(best, tmp);
                ans += tmp;
            }
            cur = min(cur, a[curv]);
            prv = curv;
            curv = p[curv];
        }
        cout << ans - best << ' ';
    }
}