#include<bits/stdc++.h>
#define fast_io ios_base::Synnc_with_stdio(0); cin.tie(0); cout.tie(0);
#define F first
#define S second
#define pb push_back

typedef long long ll;
using namespace std;
#define int ll
const int N = 3e5+100;
int a[N];
vector< int > g[N];
int p[N];

int dfs(int v, int p, int x)
{
    if(v!=1 && a[v]<x)return 0;
    int ans=1;
    for(auto to : g[v])
        ans+=dfs(to,v,x);
    return ans;
}
int32_t main()
{
    #ifdef ROADTOBELEGEND
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif // ROADTOBELEGEND


    int n,q;
    cin>>n>>q;

    for(int i=1;i<n;++i)
    {
        cin>>p[i];
        --p[i];
        g[p[i]].pb(i);
    }

    for(int i=0;i<n;++i)
        cin>>a[i];



    p[0]=0;
    while(q--)
    {
        int v;
        cin>>v;

        --v;
        if(v==0){cout<<0<<'\n'; continue;}

        int ans=n;
        for(int i=0;i<=0;++i)
        {
            if(i==v)continue;

            int x=a[i];
            a[i]=0;

            int z=a[v],u=v;
            while(u>0)z=min(z,a[u]),u=p[u];

            ans=min(ans, dfs(1, -1, z));
            a[i]=x;
        }

        cout<<ans<<'\n';
    }


    return 0;
}


