#include<bits/stdc++.h>

using namespace std;
#define int long long
const int MOD = 998244353;

vector<vector<int>> g;
vector<int> sizes;
vector<int> depth;

void dfs(int v, int from) {
    depth[v] = depth[from] + 1;
    sizes[v] = 1;
    for (int u: g[v]) {
        if (u == from) continue;
        dfs(u, v);
        sizes[v] += sizes[u];
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int n, k;
    cin >> n >> k;
    g.resize(n);
    int x;
    for (int i = 0; i < k; i++) {
        cin >> x;
        x--;
    }
    for (int i = 1; i < n; i++) {
        int p;
        cin >> p;
        p--;
        g[p].push_back(i);
        g[i].push_back(p);
    }
    depth.assign(n, 0);
    sizes.assign(n, 0);
    dfs(0, 0);
    vector<int> cnt;
    for (int u: g[x]) {
        if (depth[u] > depth[x]) {
            cnt.push_back(sizes[u]);
        }
    }
    vector<int> p2(n + 67);
    p2[0] = 1;
    for (int i = 1; i < p2.size(); i++) {
        p2[i] = p2[i - 1] * 2 % MOD;
    }
    int sum = accumulate(cnt.begin(), cnt.end(), 0ll);
    int res = p2[sum + 1] - 1;
    for (int i: cnt) {
        res -= p2[i] - 1;
        res = (res + 2 * MOD) % MOD;
    }
    cout << res << endl;
    return 0;        
}