#include <bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define ff first
#define ss second

const int INF = 998244353;

ll ans = 0;
vector<vector<int>> g;
vector<int> sz;

ll powf(ll x, int p) {
    if (p == 0) return 1;
    if (p == 1) return x;
    ll g = powf(x, p / 2);
    g = (g * g) % INF;
    if (p % 2 == 0) return g;
    else return (g * x) % INF;
}

void dfs_sz(int v, int p) {
    sz[v] = 1;
    for (int to: g[v]) {
        if (to == p) continue;
        dfs(to, v);
        sz[v] += sz[to];
    }
}

void solve() {
    int n, k;
    cin >> n >> k;
    vector<int> x(k);
    for (int i = 0; i < k; ++i) {
        cin >> x[i];
        --x[i];
    }
    sort(all(x));

    g.resize(n);
    int pr = 0;
    for (int i = 1; i < n; ++i) {
        int p;
        cin >> p;
        if (i == x[0]) pr = p;
        g[i].push_back(p - 1);
        g[p - 1].push_back(i);
    }

    sz.resize(n);
    int v = x[0];
    dfs_sz(v, pr);

    int ans = powf(2, sz[v]);
    int cnt = 0;
    for (int to: g[v]) {
        if (to == pr) continue;
        cnt += powf(2, sz[to]);
        cnt %= INF;
    }

    cout << (ans + INF - cnt) % INF << '\n';
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
