#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int N = 1e6 + 11;
const int mod = 998244353;
vector<int> g[N];
#define int long long
int sz[N];
bool mark[N];
int fact[N];
int mult (int a, int b) {
    return 1LL * a * b % mod;
}
int bpow (int a, int n) {
    int res = 1;
    while (n) {
        if (n & 1) res = mult (res, a);
        a = mult (a, a);
        n >>= 1;
    }
    return res;
}
int del (int a, int b) {
    return mult (a, bpow (b, mod - 2));
}
int C (int n, int k) {
    if (k > n) return 0;
    return del (fact[n], mult (fact[k], fact[n - k]));
}
int sub (int a, int b) {
    a -= b;
    if (a < 0) a += mod;
    return a;
}
void dfs (int v) {
    sz[v] = 1;
    for (auto to : g[v]) {
        dfs (to);
        sz[v] += sz[to];
    }
    if (mark[v]) {
        int ans = sub(bpow (2, sz[v]), 1);
        for (auto to : g[v]) {
            ans = sub (ans, sub(bpow (2, sz[to]), 1));
        }
        cout << ans << '\n';
        exit(0);
    }
}
signed main () {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // LOCAL
    int n, k;
    cin >> n >> k;
    fact[0] = 1;
    for (int i =1 ; i < N; ++i) fact[i] = mult (fact[i -1 ], i);
    for (int i =1 ; i <= k; ++i) {
        int x; cin >> x;
        mark[x] = 1;
    }
    for (int i = 2; i <= n; ++i) {
        int p; cin >> p;
        g[p].push_back (i);
    }
    dfs (1);
}

