#include <iostream>
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T> using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

using ll = long long;
using ld = long double;

mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());

ll rand1(ll a, ll b) {
    return uniform_int_distribution<ll> (a, b) (gen);
}

void dfs(ll v, ll x, vector<ll> &p, vector<vector<ll>> &g, vector<ll> &dp, vector<ll> &a, ll ban) {
    dp[v] = 1;
    for (auto &u : g[v]) {
        if (p[v] == u || ban == u || a[u] < x) continue;
        dfs(u, x, p, g, dp, a, ban);
        dp[v] += dp[u];
    }
}

void solve() {
    ll n, qq;
    cin >> n >> qq;
    vector<ll> p(n, 0);
    vector<vector<ll>> g(n, vector<ll> ());
    for (ll i = 1; i < n; i++) {
        cin >> p[i];
        p[i]--;
        g[p[i]].push_back(i);
    }
    vector<ll> a(n);
    for (auto &i : a) cin >> i;
    while (qq--) {
        ll q;
        cin >> q;
        q--;
        if (q == 0) {
            cout << "0 ";
            continue;
        }
        ll mx = 1e18;
        ll cur = q;
        vector<ll> forb(n, 0);
        forb[0] = 1;
        while (cur != 0) {
            forb[cur] = 1;
            mx = min(mx, a[cur]);
            cur = p[cur];
        }
        mx = a[q];
        vector<ll> dp(n, 0);
        dfs(0, mx, p, g, dp, a, q);
        ll res = dp[0];
        for (ll i = 0; i < n; i++) {
            if (!forb[i]) res = min(res, dp[0] - dp[i]);
        }
        cout << res << " ";
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll t12 = 1;
//    cin >> t12;
    while (t12--) {
        solve();
        cout << '\n';
    }
    return 0;
}