#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, vector<ll> &brd, 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] < brd[v]) continue;
        dfs(u, brd, p, g, dp, a, ban);
        dp[v] += dp[u];
    }
}

ll ans(ll n, ll q, vector<ll> &p, vector<vector<ll>> &g, vector<ll> &a) {
    ll res = 1e18;
    if (q == 0) return 0;
    for (ll ban = 0; ban < n; ban++) {
        ll old = a[ban];
        a[ban] = 0;
        ll mx = 1e18;
        ll cur = q;
        vector<ll> brd(n, 1e18);
        while (cur != 0) {
            mx = min(mx, a[cur]);
            cur = p[cur];
            brd[cur] = mx;
        }
        for (ll i = 0; i < n; i++) {
            if (brd[i] == 1e18) brd[i] = mx;
        }
        vector<ll> dp(n, 0);
        dfs(0, brd, p, g, dp, a, q);
        res = min(res, dp[0]);
//        set<pair<ll, ll>> cur1;
//        for (auto &v : g[0]) cur1.insert({-a[v], v});
//        bool ok = false;
//        ll cnt = 0;
//        while (!ok) {
//            cnt++;
//            ll king = cur1.begin()->second;
//            cur1.erase(cur1.begin());
//            if (king == q) {
//                ok = true;
//            } else {
//                for (auto &v : g[king]) cur1.insert({-a[v], v});
//            }
//        }
//        if (dp[0] != cnt) {
//            cout << "aboba\n";
//            return 2;
//        }
        a[ban] = old;
    }
    return res;
}

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--;
        cout << ans(n, q, p, g, a) << " ";
    }
}

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