#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;
vector<bool>prib;
vector<ll>p;

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]) || (mpf[v]==mpf[q] && v!=q && s[v]>=s[q] && s[v]>=mpf[q] && !ispred(q,v)) || (ispred(v,q) && v!=q)){
        sum[v]=1;
        prib[v]=true;
    }
    else if (mpf[v]==mpf[q] && s[v]<s[q] && !ispred(q,v)){
        prib[v]=false;
    }
    else{
        sum[v]=0;
    }
    if (mpf[v]==mpf[q]){
        prib[v]=(prib[p[v]] && prib[v]);
    }
    for (auto u:G[v]){
        dfs2(u, q);
        sum[v]+=sum[u]*prib[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);
    p.assign(n,0);
    s.assign(n,0);
    sum.assign(n,0);
    prib.assign(n,false);
    for (i=1;i<n;i++){
        cin>>p[i];
        p[i]--;
        G[p[i]].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--;
        for (i=0;i<n;i++){
            prib[i]=false;
        }
        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;
}
