#include<bits/stdc++.h>

#define ll long long

#define debug(x) cerr << (#x) << '=' << x << '\n';

using namespace std;

ll mod = 998244353;

vector<vector<ll>> g;
vector<bool> is_t;
vector<bool> used;
vector<ll> sz;
vector<ll> pw;
ll ans;

void dfs(ll v) {
    used[v] = true;
    sz[v] = 1;
    for (auto u: g[v]) {
        if (used[u]) continue;
        dfs(u);
        sz[v] += sz[u];
    }
    if (!is_t[v]) return;
    ans += pw[sz[v]];
    if (ans >= mod) ans -= mod;
    ans -= 1;
    if (ans < 0) ans += mod;
    for (auto u: g[v]) {
        ans -= pw[sz[u]];
        if (ans < 0) ans += mod;
        ans += 1;
        if (ans >= mod) ans -= mod;
    }
}

int main() {
    ll n, k;
    cin >> n >> k;
    pw.resize(n + 1, 1);
    for (ll i = 1; i <= n; i++) {
        pw[i] = (pw[i - 1] * 2) % mod;
    }
    is_t.resize(n, false);
    ll c1 = 0;
    for (ll i = 0; i < k; i++) {
        cin >> c1;
        c1--;
        is_t[c1] = true;
    }
    g.resize(n, vector<ll>(0));
    for (ll i = 1; i < n; i++) {
        cin >> c1;
        c1--;
        g[c1].push_back(i);
        g[i].push_back(c1);
    }
    sz.resize(n, 0);
    used.resize(n, false);
    ans = 0;
    dfs(0);
    cout << ans << '\n';
    return 0;
}