/*#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")*/

#include <iostream>
#include <math.h>
#include <iostream>
#include <string>
#include <fstream>
#include <set>
#include <vector>
#include <algorithm>
#include <random>

using namespace std;
using ll = long long;
using ld = long double;
const ll MAXN =3e5+5;
const ll MOD = 1e9 + 7;
ll ves[MAXN];
vector<vector<ll>> graph;
ll pred[MAXN];
ll sums;
ll maxs;
ll hx = 0;
ll dfs2(ll v,ll p,ll mins){
    ll cnt = 0;
    for (auto u:graph[v]){
        if (u != p){
            cnt += dfs2(u,v,mins);
        }
    }
    if (ves[v] > mins){
        cnt ++;
    }
    return cnt;
}
void dfs(ll v,ll p,ll mins){
    if (p == -1){
        if (v == 0){
            return;
        }
        hx ++;
        dfs(pred[v],v,ves[v]);
        return;
    }
    for (auto u:graph[v]){
        if (u != pred[v] && u != p){
            ll h = dfs2(u,v,mins);
            maxs = max(h,maxs);
            sums += h;
        }
    }
    if (v == 0){
        return;
    }
    hx ++;
    dfs(pred[v],v,min(ves[v],mins));
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n,q,p,v;
    cin >> n >> q;
    graph.resize(n);
    pred[0] = -1;
    for (int i = 0;i<n-1;i++){
        cin >> p;
        pred[i+1] = p-1;
        graph[p-1].push_back(i+1);
    }
    for (int i = 0;i<n;i++){
        cin >> ves[i];
    }
    for (int i = 0;i<q;i++){
        cin >> v;
        v--;
        hx = 0;
        sums = 0;
        maxs = 0;
        dfs(v,-1,MOD);
        cout << sums - maxs + hx << " ";
    }
}
