#include "bits/stdc++.h"
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>

// using namespace __gnu_pbds;
// template<class T> 
// using ordered_set = <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

using namespace std;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using ll = long long;
using ld = long double;

#define int long long

const int inf = 1'000'000'000'000'000'000;

const int mod = 998244353;

int sum(int a, int b) {
    if (a + b >= mod) {
        return a + b - mod;
    }
    if (a + b < 0) {
        return a + b + mod;
    }
    return a + b;
}
int mul(int a, int b) {
    return 1ll * a * b % mod;
}

int binpow(int a, int b) {
    int deg = a;
    int res = 1;
    for (int i = 0; i <= 30; ++i) {
        if ((b >> i) & 1) {
            res = mul(res, deg);
        }
        deg = mul(deg, deg);
    }
    return res;
}

const int maxn = 1'000'001;
vector<int> g[maxn];
bool x[maxn];

int sz[maxn];
void dfs(int v) {
    sz[v] = 1;
    for (auto& u : g[v]) {
        dfs(u);
        sz[v] += sz[u];
    }
}

void solve() {
    int n, k;
    cin >> n >> k;

    for (int i =0 ; i < k; ++i) {
        int xi;
        cin >> xi;
        x[xi] = true;
    }
    for (int i = 2; i <= n; ++i) {
        int pi;
        cin >> pi;
        // g[i].emplace_back(pi);
        g[pi].emplace_back(i);
    }
    dfs(1);
    int ans = 1;
    for (int i = 1; i <= n; ++i) {
        if (x[i]) {
            int pr = 1;
            int s = 0;
            for (auto& u : g[i]) {
                pr = mul(pr, binpow(2, sz[u]));
                s = sum(s, sum(binpow(2, sz[u]), -1));
            }
            ans = sum(binpow(2, sz[i] - 1), sum(pr, -s - 1));
        }
    }
    cout << ans << '\n';
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    #ifdef LOCAL
    freopen("C:\\Users\\User\\Documents\\olymp\\input.txt", "r", stdin);
    freopen("C:\\Users\\User\\Documents\\olymp\\output.txt", "w", stdout);
    #endif

    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }

    return 0;
}