#include <bits/stdc++.h>

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
using vii = vector<pair<int, int>>;
using vc = vector<char>;
using vb = vector<bool>;
template<typename T>
using ve = vector<T>;
template<typename T1, typename T2>
using pr = pair<T1, T2>;

const int INF = 1e9 + 1;
const long long INFLL = 1e18 + 1;
const int MOD = 1e9 + 7;

inline void fchmin(int &a, int &b) { a = min(a, b); }
inline void fchmax(int &a, int &b) { a = max(a, b); }

template<typename T>
inline bool chmin(T &a, T &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<typename T>
inline bool chmax(T &a, T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

// #include<ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// using oset = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;

int reps = 1;

ve<vi> g;

vi s;

int dfs(int v, int sii, int p) {
    int res = 0;
    if (s[v] < sii) return res;
    else res++;
    for (auto u : g[v]) {
        if (u == p) continue;
        res += dfs(u, sii, v);
    }
    return res;
}

void solve() {
    int n, q; cin >> n >> q;
    g.clear();
    g.resize(n);
    vi P(n, -1);
    for (int i = 1; i < n; i++) {
        int p; cin >> p; p--;
        P[i] = p;
        // g[i].push_back(p);
        g[p].push_back(i);
    }
    s.clear();
    s.resize(n);
    for (int i = 0; i < n; i++) cin >> s[i];
    while (q--) {
        int v; cin >> v; v--;
        int lstv = v;
        int st = s[v];
        int cnt = 0;
        int summ = 0;
        int mx = 0;
        while (P[v] != -1) {
            lstv = v;
            st = min(st, s[v]);
            cnt++;
            v = P[v];
            for (auto u : g[v]) {
                if (u != P[v] && u != lstv) {
                int cur = dfs(u, st, v);
                    mx = max(mx, cur);
                    summ += cur;
                }
            }
        }
        cout << cnt + summ - mx << ' ';
    }
    cout << '\n';
}

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

    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    cin >> reps;
    #endif

    for (int i = 1; i <= reps; i++) {
        #ifdef LOCAL
        cout << "===== Test #" << i << " ========\n";
        #endif
        solve();
        #ifdef LOCAL
        cout << "==== End test =====\n\n";
        #endif
    }
}