// #pragma GCC optimize("Ofast")

#include <iostream>
#include <bits/stdc++.h>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define all(x) x.begin(), x.end()

#ifdef DEBUG
    #define debug(x) {cout << __func__ << ":" << __LINE__ << " " << #x << " = " << x << "\n";};
    #define debugw(x) {cout << __func__ << ":" << __LINE__ << " " << x << "\n";};
#else
    #define debug(x)
    #define debugw(x)
#endif

const int mod = 998'244'353;
const int N = 1e6;

int n, k;
vector<int> g[N];
int x[N], dp[N], sz[N];

int binpow(int a, int n) {
    if (n == 0) {
        return 1;
    } else if (n % 2 == 0) {
        int res = binpow(a, n / 2);
        return ( (ll)res * res ) % mod;
    } else {
        int res = binpow(a, n - 1);
        return ((ll)res * a) % mod;
    }
}

int dfs(int v, int p) {
    sz[v] = 1;
    for (auto u: g[v]) {
        if (u == p) continue;
        sz[v] += dfs(u, v);
    }
    return sz[v];
}

void dfs2(int v, int p) {
    dp[v] = (binpow(2, sz[v]) + mod - 1) % mod;

    for (auto u: g[v]) {
        if (u != p) {
            dfs2(u, v);
            dp[v] = (dp[v] + mod - dp[u]) % mod;
        }
    }
}

void solve() {
    cin >> n >> 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);
        g[i].push_back(p);
    }

    dfs(0, 0);
    dfs2(0, 0);

    cout << dp[x[0]] << "\n";
}

signed main() {
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);

    // ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    // cout << set_precision(8) << fixed;

    // ll T;
    // cin >> T;
    // while (T--) solve();

    solve();
}