#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <iomanip>
#include <random>
#include <ranges>
#include <chrono>
#define eb emplace_back

using namespace std;

using ll = long long;
using lll = __int128;
using db = double;
using ld = long double;

const int INF = 1'000'000'000;
const ll LINF = 1'000'000'000'000'000'000;
const ll MOD = 998'244'353;

int rnd() {
    return (rand() / RAND_MAX);
}

ll modSum(ll a, ll b) {
    ll ans = a + b;
    if (ans >= MOD) {
        ans -= MOD;
    }
    return ans;
}

ll modMinus(ll a, ll b) {
    ll ans = a - b;
    if (ans < 0) {
        ans += MOD;
    }
    return ans;
}

ll modMul(ll a, ll b) {
    ll ans = (a * b) % MOD;
    return ans;
}

ll modPow(ll a, ll pw) {
    if (pw == 0) {
        return 1;
    }
    ll ans = modPow(a, pw / 2);
    ans = modMul(ans, ans);
    if (pw % 2 == 1) {
        ans = modMul(ans, a);
    }
    return ans;
}

vector <int> x;
vector <int> p;
vector <vector <int>> g;
vector <ll> sz;

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

int main() {
    ios_base::sync_with_stdio();
    cin.tie(nullptr);
    int n, k;
    cin >> n >> k;
    x.resize(k);
    for (int i = 0; i < k; ++i) {
        cin >> x[i];
        --x[i];
    }
    sort(x.begin(), x.end());
    p.resize(n, -1);
    g.resize(n);
    sz.resize(n);
    for (int i = 1; i < n; ++i) {
        cin >> p[i];
        --p[i];
        g[p[i]].eb(i);
        g[i].eb(p[i]);
    }
    dfs(0);
    ll ans = modPow(2, sz[x[0]] - 1);
    ll cnt = 0;
    for (auto i : g[x[0]]) {
        if (i == p[x[0]]) {
            continue;
        }
        ans = modSum(ans, modMul(modMinus(modPow(2, cnt), 1), modMinus(modPow(2, sz[i]), 1)));
        cnt = modSum(cnt, sz[i]);
    }
    cout << ans;
}