#include <bits/stdc++.h>

using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll infll = 1e18;

template<typename T>
istream &operator>>(istream &is, vector<T> &a) {
    for (auto &i : a) {
        is >> i;
    }
    return is;
}

const int mod = 998244353;

int norm(int x) {
    if (x < 0) {
        x += mod;
    }
    if (x >= mod) {
        x -= mod;
    }
    return x;
}

int mul(int a, int b) {
    return (a * 1ll * b) % mod;
}

vector<int> pw;

vector<bool> mark;
vector<vector<int>> g;
vector<int> sz;
vector<int> dp;
vector<int> sum_sz, sum_dp;

void dfs(int v, int p = -1) {
    sz[v] = 1;
    for (auto u : g[v]) {
        if (u != p) {
            dfs(u, v);
            sz[v] += sz[u];
        }
    }
    if (!mark[v]) {
        for (auto u : g[v]) {
            if (u != p) {
                sum_sz[v] += sum_sz[u];
                (sum_dp[v] += sum_dp[u]) %= mod;
            }
        }
        return;
    }
    int sum = 0, cnt = 0;
    int summ = 1;
    for (auto u : g[v]) {
        if (u != p) {
            sum += sum_sz[u];
            if (sum_sz[u] > 0) {
                ++cnt;
            }
            (summ += sum_dp[u]) %= mod;
        }
    }
    if (cnt == 0) {
        dp[v] = pw[sz[v] - 1];
        int prod = 1;
        for (auto u : g[v]) {
            if (u != p) {
                prod = mul(prod, pw[sz[u]]);
            }
        }
        prod = norm(prod - 1);
        for (auto u : g[v]) {
            if (u != p) {
                prod = norm(prod - norm(pw[sz[u]] - 1));
            }
        }
        (dp[v] += prod) % mod;
    } else if (cnt == 1) {
        dp[v] = pw[sz[v] - sum - 1];
        int prod = 1;
        for (auto u : g[v]) {
            if (u != p) {
                prod = mul(prod, pw[sz[u] - sum_sz[u]]);
            }
        }
        prod = norm(prod - 1);
        (dp[v] += prod) %= mod;
    } else {
        dp[v] = pw[sz[v] - sum - 1];
        int prod = 1;
        for (auto u : g[v]) {
            if (u != p) {
                prod = mul(prod, pw[sz[u] - sum_sz[u]]);
            }
        }
        (dp[v] += prod) %= mod;
    }
    dp[v] = mul(dp[v], summ);
    sum_sz[v] = sz[v];
    sum_dp[v] = dp[v];
}

int32_t main() {
#ifdef LOCAL
    freopen("C:\\work\\input.txt", "r", stdin);
#else
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    int n, k;
    cin >> n >> k;
    mark.resize(n);
    for (int i = 0; i < k; ++i) {
        int v;
        cin >> v;
        --v;
        mark[v] = 1;
    }
    g.resize(n);
    for (int i = 1; i < n; ++i) {
        int p;
        cin >> p;
        --p;
        g[p].push_back(i);
        g[i].push_back(p);
    }
    pw.resize(n + 1);
    pw[0] = 1;
    for (int i = 1; i <= n; ++i) {
        pw[i] = mul(pw[i - 1], 2);
    }
    sz.resize(n);
    dp.resize(n);
    sum_sz.resize(n);
    sum_dp.resize(n);
    dfs(0);
    cout << sum_dp[0] << "\n";
    return 0;
}
