#pragma GCC optimize("O3,unroll-loops")

#include <bits/stdc++.h>

using namespace std;
using ll = long long int;
using ull = unsigned long long int;

#define all(x) (x).begin(), (x).end()
#define rall(X) (x).rbegin(), (x).rend()

vector<int> s;
vector<vector<int>> g;
vector<int> c;
vector<int> ok;
void dfs(int u, int x)
{
    if (s[u] < x)
    {
        c[u] = 0;
        return;
    }

    if (ok[u] != -1)
        x = ok[u];
    c[u] = 1;
    for (int v : g[u])
    {
        dfs(v, x);
        c[u] += c[v];
    }
}

void solve()
{
    int n, q;
    cin >> n >> q;

    s.resize(n);
    g.resize(n);
    c.resize(n);
    ok.resize(n);
    vector<int> p(n);
    p[0] = -1;
    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];
    s[0] = n + 1;

    while (q--)
    {
        int v;
        cin >> v;
        --v;

        fill(all(ok), -1);
        int x = INT_MAX;
        for (int u = v; u != -1; u = p[u])
        {
            ok[u] = x;
            x = min(x, s[u]);
        }
        fill(all(c), -1);

        dfs(0, x);

        int ban = 0;
        for (int u = v; u != 0; u = p[u])
        {
            for (int a : g[p[u]])
            {
                if (a == u)
                    continue;
                ban = max(ban, c[a]);
            }
        }

        cout << c[0] - c[v] - ban << ' ';
    }
    cout << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
#ifdef LOCAL
    freopen("C:/work/Day 1/in.txt", "r", stdin);
    freopen("C:/work/Day 1/out.txt", "w", stdout);
    cin >> t;
#else
    t = 1;
#endif

    while (t--)
        solve();
    return 0;
}
