#include<iostream>
#include<vector>
#include<cmath>
#include<map>
#include<algorithm>
#include<set>
#include<iomanip>
#include<random>
#include<chrono> 
using namespace std;
using ll = long long;
using ld = long double;

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx")

#define int long long
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

const int mod = 998244353;

int bin(int a, int n) {
    int res = 1;
    while (n) {
        if (n & 1) {
            res = a * res % mod;
        }
        n /= 2;
        a = a * a % mod;
    }
    return res;
}

vector<vector<int>> g;
vector<int> sz;

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

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

void solve() {
    int n, k;
    cin >> n >> k;
    vector<int> x(k);
    for (int i = 0; i < k; ++i) {
        cin >> x[i];
    }
    g.resize(n);
    sz.resize(n);
    for (int i = 1; i < n; ++i) {
        int p;
        cin >> p;
        --p;
        g[p].push_back(i);
    }
    dfs(0);
    int ver = x[0] - 1;
    int dop = bin(2, n - sz[ver]);
    int ans = goy(bin(2, sz[ver]) - 1) * dop % mod;
    for (auto to : g[ver]) {
        ans -= bin(2, sz[to]) * dop % mod;
        ans += dop;
        goy(ans);
    }
    cout << ans << '\n';
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
}
