#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()

using namespace std;

template<class C> using vec = vector<C>;
using vi = vector<int>;
using pii = pair<int, int>;
using vpi = vec<pii>;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    int n, tt;
    cin >> n >> tt;
    vi p(n);
    vec<vi> g(n);
    vi pp(n);
    for (int i = 1; i < n; i++) {
        int pr;
        cin >> pr;
        pr--;
        pp[i] = pr;
        g[pr].push_back(i);
    }
    vi s(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    vi val(n);
    vec<map<int, int>> sub(n);
    { // dfs
        for (int i = n - 1; i >= 0; i--) {
            if (i == 3) {
                cout<<"";
            }
            int heavy = -1;
            for (auto& to : g[i]) {
                if (heavy == -1 || sub[heavy].size() < sub[to].size()) {
                    heavy = to;
                }
            }
            if (heavy != -1) {
                sub[i] = sub[heavy];
            }
            for (auto& to : g[i]) {
                for (auto& [va, cnt] : sub[to]) {
                    sub[i][va] += cnt;
                }
            }
            int cnt_mn = 1;
            while (!sub[i].empty() && sub[i].rbegin()->first > s[i]) {
                cnt_mn += sub[i].rbegin()->second;
                sub[i].erase(--sub[i].end());
            }
            sub[i][s[i]] += cnt_mn;
        }
        for (int i = 0; i < n; i++) {
            int suf = 0;
            for (auto& [a, b] : sub[i]) {
                suf += b;
            }
            for (auto& [a, b] : sub[i]) {
                int old = b;
                b = suf;
                suf -= old;
            }
        }
    }
    auto get_ans = [&](int i) -> int {
        int cur_mn = INT_MAX;
        int pred = -1;
        int res = 0;
        int mx = 0;
        while (i != 0) {
            res++;
            pred = i;
            cur_mn = min(cur_mn, s[i]);
            i = pp[i];
            for (auto& to : g[i]) {
                if (to == pred) continue;
                auto it = sub[to].upper_bound(cur_mn);
                if (it != sub[to].end()) {
                    mx = max(mx, it->second);
                    res += it->second;
                }
            }
        }
        return res - mx;
    };
    while (tt--) {
        int u;
        cin >> u;
        u--;
        cout << get_ans(u) << '\n';
    }
}