#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <unordered_map>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>

#define all(v) v.begin(), v.end()
#define len(v) (int)v.size()

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

vector<int> pr;
vector<vector<int>> g;
vector<int> s;
vector<int> dp;
const int INF = 2e9;
const int Max = 100;
vector<int> vs;
vector<int> sp;
vector<int> h;
vector<vector<int>> alltree;
vector<int> ALLtree;

int dfs1(int v, int c)
{
    return alltree[v].end() - lower_bound(all(alltree[v]), c);
}

void dfsalltree(int v, int p, int mn)
{
    sp[v] = p;
    vs.push_back(min(mn, s[v]));
    for (int u : g[v])
    {
        h[u] = h[v] + 1;
        dfsalltree(u, p, min(mn, s[v]));
    }
}

void dfs(int v, int p)
{
    if (p != -1)
    {
        int lt = v;
        int cur = p;
        int sum = 0;
        int mx = 0;
        int len = 0;
        int mns = s[v];
        cur = 0;
        lt = sp[v];
        //    ++len;
        len = h[v] - h[sp[v]] + 1;
        for (int u : g[cur])
        {
            if (u == lt) continue;
            int add = dfs1(u, mns);
            sum += add;
            mx = max(mx, add);
        }
        mns = min(mns, s[cur]);
        dp[v] = sum - mx + len;
        //cout << v + 1 << ' ' << dp[v] << ' ' << sum << ' ' << mx << ' ' <<
    } else
    {
        dp[v] = 0;
    }
    for (int u : g[v])
    {
        dfs(u, v);
    }
}

vector<int> merg(vector<int> &a, vector<int> &b)
{
    vector<int> c;
    int i1 = 0, i2 = 0;
    while (i1 < len(a) || i2 < len(b))
    {
        int c1 = INF;
        if (i1 < len(a))
        {
            c1 = a[i1];
        }
        int c2 = INF;
        if (i2 < len(b))
        {
            c2 = b[i2];
        }
        if (c1 <= c2)
        {
            c.push_back(c1);
            ++i1;
        } else
        {
            c.push_back(c2);
            ++i2;
        }
    }
    return c;
}

int main()
{
    cin.tie(0)->sync_with_stdio(0);
    int n, q;
    cin >> n >> q;
    pr.resize(n);
    g.resize(n);
    s.resize(n);
    h.resize(n);
    sp.resize(n);
    dp.resize(n);
    alltree.resize(n);
    pr[0] = -1;
    for (int i = 1; i < n; ++i)
    {
        cin >> pr[i];
        --pr[i];
        g[pr[i]].push_back(i);
    }
    for (int i = 0; i < n; ++i)
    {
        cin >> s[i];
    }
    for (int v : g[0])
    {
        vs.clear();
        h[v] = 1;
        dfsalltree(v, v, s[v]);
        alltree[v] = vs;
        reverse(all(alltree[v]));
        ALLtree = merg(ALLtree, alltree[v]);
    }
    //dfs(0, -1);
    vector<ll> pre(n);
    for (int v : g[0])
    {
        int lt = v;
        int cur = pr[v];
        int sum = 0;
        int mx = 0;
        int len = 0;
        int mns = s[v];
        cur = 0;
        lt = sp[v];
        //    ++len;
        len = h[v] - h[sp[v]] + 1;
        for (int u : g[cur])
        {
            if (u == lt) continue;
            int add = dfs1(u, mns);
            sum += add;
            mx = max(mx, add);
        }
        mns = min(mns, s[cur]);
        dp[v] = sum - mx + len;
    }
    for (int i = 0; i < q; ++i)
    {
        int v;
        cin >> v;
        --v;
        cout << dp[sp[v]] << ' ';
    }

    return 0;
}

