#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pll=pair<ll,ll>;
using dbl=double;
dbl const PI=acos(-1.0);
ll const mod=998244353;
ll const inf=1e18;
void gg(){
    cout<<1<<endl;
}
ll bit(ll x,ll i){
    return((x>>i)&1);
}
void dfs_clc(ll v,ll p,vector<vector<ll>>& g,vector<ll>& dp,vector<ll>& sz,vector<ll>& pw){
    sz[v]++;
    ll sum=0;
    for(ll u:g[v]){
        if(u!=p){
            dfs_clc(u,v,g,dp,sz,pw);
            sz[v]+=sz[u];
            sum=(sum+pw[sz[u]])%mod;
        }
    }
    dp[v]=(pw[sz[v]]-sum+mod)%mod;
}

void solve(){
    ll n,k;
    cin>>n>>k;
    vector<ll> a(k);
    for(ll i=0;i<k;i++)cin>>a[i];
    vector<vector<ll>> g(n+1);
    vector<ll> pw(n+1),sz(n+1),dp=sz;
    pw[0]=1,pw[1]=2;
    for(ll i=2;i<=n;i++){
        ll j;
        cin>>j;
        g[i].push_back(j);
        g[j].push_back(i);
        pw[i]=(pw[i-1]*2)%mod;
    }
    dfs_clc(1,1,g,dp,sz,pw);
    cout<<(dp[a[0]]+1)%mod;
}

int main()
{
    ll tqqq=1;
    //cin>>tqqq;
    while(tqqq--){
        solve();
        cout<<'\n';
    }

    return 0;
}
