//#pragma GCC optimize("O3, Ofast, unroll-loops, inline, no-stack-protector")
#include <bits/stdc++.h>
//#pragma GCC target("avx2")

using namespace std;

using ll = long long;
using pii = pair<int, int>;

vector<vector<int>> g;
vector<int> cnt, s;


int ans = 1e9;
vector<int> p;

void calc(int v, int val) {
    if (v != 0 && s[v] < val) return;
    cnt[v] = 1;
    for (auto u : g[v]) {
        calc(u, val);
        cnt[v] += cnt[u];
    }
}

void dfs(int v, int dp0, int dp1, int val, int last) {
    if (last != -1) {
        dp0 += 1;
        dp1 += 1;
    }
    int sum = 0, mx = 0;
    for (auto u : g[v]) {
        if (u == last) continue;
        calc(u, val);
        sum += cnt[u];
        mx = max(mx, cnt[u]);
    }
    dp1 = min(dp0 + sum - mx, dp1 + sum);
    dp0 += sum;
    if (v == 0) {
        ans = dp1;
        return;
    }
    dfs(p[v], dp0, dp1, min(val, s[v]), v);
}



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, q;
    cin >> n >> q;
    g.resize(n);
    p.resize(n, -1);
    s.resize(n);
    for (int i = 1; i < n; ++i) {
        cin >> p[i];
        --p[i];
        g[p[i]].push_back(i);
    }
    for (int i = 0; i < n; ++i) cin >> s[i];
    while (q --> 0) {
        int v;
        cin >> v;
        --v;
        cnt.assign(n, 0);
        dfs(v, 0, 0, int(1e9), -1);
        cout << ans << " ";
    }
}
