#include <bits/stdc++.h>
using namespace std;
using ll = long long;

vector<ll>tin,tout,mpf,s;
vector<vector<ll>>G;
vector<ll>sum;
ll timer=0;

void dfs(ll v){
    tin[v]=timer++;
    for (auto u:G[v]){
        mpf[u]=min(mpf[v],s[u]);
        dfs(u);
    }
    tout[v]=timer++;
}

bool ispred(ll v, ll u){
    return (tin[v]<=tin[u] && tout[v]>=tout[u]);
}

void dfs2(ll v, ll q){
    if ((mpf[v]>=mpf[q] && v!=q && s[v]>=s[q]) || (ispred(v,q) && v!=q)){
        sum[v]=1;
    }
    else{
        sum[v]=0;
    }
    for (auto u:G[v]){
        dfs2(u, q);
        sum[v]+=sum[u];
    }
}

int main() {
    ll i,j,n,q;
    cin>>n>>q;
    G.assign(n,{});
    tout.assign(n,0);
    tin.assign(n,0);
    mpf.assign(n,0);
    s.assign(n,0);
    sum.assign(n,0);
    for (i=1;i<n;i++){
        ll p;
        cin>>p;
        p--;
        G[p].push_back(i);
    }
    for (i=0;i<n;i++){
        cin>>s[i];
    }
    s[0]=1e9+1;
    mpf[0]=1e9+1;
    dfs(0);
    while(q--){
        ll qi;
        cin>>qi;
        qi--;
        dfs2(0,qi);
        ll mx=0;
        for (i=0;i<n;i++){
            if (!ispred(i,qi) && !ispred(qi,i)){
                mx=max(mx,sum[i]);
            }
        }
        cout<<sum[0]-mx<<" ";
    }
    return 0;
}
