#include <bits/stdc++.h>

using namespace std;

#define sll __int128_t
#define ll long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define size(x) (int)(x).size()

const int MOD = 998244353, MAXN = 1e6 + 100, inf = 1e9;

int add(int a, int b) {
    if (a + b >= MOD) {
        return a + b - MOD;
    }
    return a + b;
}

int sub(int a, int b) {
    if (a - b < 0) {
        return a - b + MOD;
    }
    return a - b;
}

int mult(int a, int b) {
    return ((ll)a * b) % MOD;
}

int kv(int a) {
    return ((ll)a * a) % MOD;
}

int fast_pow(int x, int a) {
    if (a == 0) return 1;
    if (a == 1) return x;
    if (a & 1) return mult(x, fast_pow(x, a - 1));
    return kv(fast_pow(x, a / 2));
}

vector<int> g[MAXN];
int child[MAXN];

void dfs(int v) {
    child[v] = 1;
    for (auto to : g[v]) {
        dfs(to);
        child[v] += child[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]--;
    }
    for (int i = 1; i < n; i++) {
        int p; cin >> p; p--;
        g[p].push_back(i);
    }
    dfs(0);
    int ans = fast_pow(2, n);
    for (auto to : g[x[0]]) {
        ans = sub(ans, fast_pow(2, child[to]) - 1);
    }
    ans = sub(ans, fast_pow(2, n - child[x[0]]));
    cout << ans;
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int ttt = 1;
    //cin >> ttt;
    while (ttt--) {
        solve();
    }
}