
// #pragma GCC optmize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()

typedef long long ll;
typedef long double ld;

template <typename T>
void sort(T &s) {
    sort(all(s));
}

template<typename T>
void rsort(T &s) {
    sort(rall(s));
}

const int inf = 2e9 + 2000;
const ll infll = 2e18 + 2000;
const int R = (1 << 20);
mt19937 rnd(26);

template <typename T>
struct point {
    T x, y;
    point(T x, T y) : x(x), y(y) {}
    point(point a, point b) : x(b.x - a.x), y(b.y - a.y) {}

    point operator + (point &o) const {
        return {x + o.x, y + o.y};
    }

    point operator * (const T k) const {
        return {x * k, y * k};
    }

    T operator * (const point &o) const {
        return x * o.x + y * o.y;
    }

    T operator % (const point &o) const {
        return x * o.y - y * o.x;
    }

    T len2() {
        return x * x + y * y;
    }

    ld len() {
        return sqrt(x * x + y * y);
    }
};

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

int ma = 0;
int su = 0;
int cv;
int mi = inf;

int t = 0;
vector<int> tin, tout;
void dfs0(int v, int pr) {
    tin[v] = t++;
    for (auto u : g[v]) {
        if (u != pr) {
            dfs0(u, v);
        }
    }
    tout[v] = t;
}

vector<int> ml;

int dfs(int v, int pr, int lca) {
    if (v == cv) {
        return 0;
    }
    if (tin[cv] >= tin[v] && tout[cv] <= tout[v]) {
        int cs = 0;
        for (auto u : g[v]) {
            if(u != pr) {
                if (tin[cv] >= tin[u] && tout[cv] <= tout[u]) {
                    int cu = dfs(u, v, u);
                    cs += cu;
                } else {
                    int cu = dfs(u, v, lca);
                    ma = max(ma, cu);
                    cs += cu;
                }
            }
        }

        return cs + 1;
    }
    int cs = 0;
    for (auto u : g[v]) {
        if (u != pr) {
            cs += dfs(u, v, lca);
        }
    }
    if (s[v] > ml[lca]) {
        return cs + 1;
    } else {
        return 0;
    }
}


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

    g.resize(n);
    s.resize(n);
    p.resize(n, -1);
    tin.resize(n);
    tout.resize(n);

    for (int i = 1; i < n; ++i) {
        int cf;
        cin >> cf;
        p[i] = cf - 1;

        g[cf - 1].push_back(i);
        g[i].push_back(cf - 1);
    }

    dfs0(0, -1);
    // for (int i = 0; i < n; ++i) {
    //     cout << tin[i] << ' ' << tout[i] << "\n";
    // }

    for (auto &i : s) {
        cin >> i;
    }

    if (n * q <= 3e7) {
        while (q--) {
            ml.assign(n, inf);
            int v;
            cin >> v;

            mi = inf;
            int uk = v - 1;
            while (uk != 0) {
                mi = min(mi, s[uk]);
                ml[p[uk]] = mi;
                uk = p[uk];
            }

            cv = v - 1;
            su = 0;
            ma = 0;

            su = dfs(0, -1, 0);
            cout << su - ma << ' ';
        }
    } else {
        vector<int> nu;
        for (int i = 0; i < n; ++i) {
            if (p[i] == 0) {
                nu.push_back(i);
            }
        }

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

            if (v == 0) {
                cout << 0 << "\n";
            } else {
                auto it = prev(upper_bound(all(nu), v));
                cout << 1 + v - *it << "\n";
            }
        }
    }
}


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int tt = 1;
    // cin >> tt;

    while (tt--) {
        solve();
    }
}
