#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
using namespace std;

const int MOD = 998244353;

int n, k;
vector<int> x, f, sz;
vector<vector<int>> g, dp, e;

int binpow(int x, int st = MOD - 2) {
    int res = 1;
    while (st) {
        if (st&1) {
            st--;
            res = res * x % MOD;
        }
        st >>= 1;
        x = x * x % MOD;
    }
    return res;
}


void dfs(int v) {
    for (auto u : g[v]) {
        dfs(u);
        sz[v] += sz[u];
    }
}

void solve() {
    cin >> n >> k;
    f.assign(n + 1, 1);
    sz.assign(n + 1, 1);
    for (int i = 2; i <= n; i++) f[i] = f[i - 1] * i % MOD;
    x.assign(n + 1, 0);
    g.assign(n + 1, {});
    dp.assign(n + 1, vector<int>(n + 1));
    for (int i = 1; i <= k; i++) {
        int v;
        cin >> v;
        x[v]++;
    }
    for (int i = 2; i <= n; i++) {
        int p;
        cin >> p;
        g[p].push_back(i);
    }
    dfs(1);
    int ans = 0;
    for (int v = 1; v <= n; v++) {
        if (!x[v]) continue;
        ans = binpow(2, sz[v]) - 1 + MOD;
        for (auto u : g[v]) {
            ans -= (binpow(2, sz[u]) - 1);
            if (ans < 0) ans += MOD;
        }
        break;
    }
    cout << ans % MOD;
}

int32_t main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    solve();
}
