#include <bits/stdc++.h>

using namespace std;

//#define int int64_t
#define fi first
#define se second

const int N = 3e5 + 12;
vector <int> g[N];
int a[N], pr[N];

int go(int v, int x) {
    if(a[v] < x)
        return 0;
    int k = 1;
    for(auto to : g[v]) {
        k += go(to, x);
    }
    return k;
}

int32_t main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // LOCAL
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, qq;
    cin >> n >> qq;
    for(int i = 2; i <= n; ++i) {
        cin >> pr[i];
        g[pr[i]].push_back(i);
    }
    for(int i = 1; i <= n; ++i) {
        cin >> a[i];
    }
    while(qq--) {
        int v;
        cin >> v;
        int my = a[v], u = v;
        v = pr[v];
        int ans = 0, mx = 0;
        while(v != 0) {
            ans++;
            for(auto to : g[v]) {
                if(to == u)
                    continue;
                int k = go(to, a[u]);
                ans += k;
                mx = max(mx, k);
            }
            u = v;
            v = pr[v];
        }
        cout << ans - mx << ' ';
    }
    return 0;
}
