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

using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ld = long double;
using o_set = tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>;

//find_by_order()
//order_of_key()

int n, q, tim = 0, cnt = 0, max1 = 0;

vector<vector<int>> g;
vector<int> p, s, tin, tout;

bool parent(int v, int u) {
    return tin[u] < tin[v] && tout[v] < tout[u];
}

void dfs(int v) {
    tin[v] = tim++;
    for (auto to : g[v]) {
        if (to != p[v]) {
            dfs(to);
        }
    }
    tout[v] = ++tim;
}

void dfs_cnt(int v, int cur) {
    if (!parent(cur, v) && s[v] <= s[cur]) {
        return;
    }
    int cur_cnt = cnt++;
    for (auto to : g[v]) {
        if (to != p[v]) {
            dfs_cnt(to, cur);
        }
    }
    if (!parent(cur, v)) {
        max1 = max(max1, cnt - cur_cnt);
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> n >> q;
    g.resize(n);
    p.reserve(n);
    s.resize(n);
    tin.resize(n, 0);
    tout.resize(n, 0);
    p[0] = -1;
    for (int i = 1; i < n; i++) {
        cin >> p[i];
        p[i]--;
        g[i].push_back(p[i]);
        g[p[i]].push_back(i);
    }
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    dfs(0);
    vector<vector<int>> g1 = g;
    vector<int> tin1 = tin, tout1 = tout;
    while (q--) {
        int v;
        cin >> v;
        v--;
        max1 = 0, cnt = 0;
        dfs_cnt(0, v);
        int cnt1 = cnt, max2 = max1;
        cout << cnt - max1 << ' ';
    }
    return 0;
}
