#include <iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<set>
#include<cassert>
#include<climits>
using namespace std;
#define int long long
const int mod = 998244353;

int add(int a, int b) {
	if (a + b >= mod) return a + b - mod;
	return a + b;
}

int sub(int a, int b) {
	if (a - b < 0) return a - b + mod;
	return a - b;
}

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

int bpow(int x, int st) {
	if (st == 0) return 1;
	if (st == 1) return x;
	int xx = bpow(x, st / 2);
	xx = mul(xx, xx);
	if (st % 2 == 1) {
		xx = mul(xx, x);
	}
	return xx;
}


vector<int> p;
vector<vector<int>> g;
vector<int> sz;
map<int, bool> mp;
void dfs(int v, int p = -1) {
	sz[v] = 1;
	for (auto u : g[v]) {
		if (u == p) continue;
		dfs(u, v);
		sz[v] += sz[u];
	}
}

vector<int> dp, sm;

void dfsd(int v, int p = -1) {
	for (auto u : g[v]) {
		if (u == p) continue;
		dfsd(u, v);
	}
	if (g[v].empty()) {
		dp[v] = 1;
		sm[v] = 1;
	}
	else {
		dp[v] = bpow(2, sz[v]);
		dp[v] = sub(dp[v], 1);
		for (auto u : g[v]) {
			dp[v] = sub(dp[v], sm[u]);
			sm[v] = add(sm[v], sm[u]);
		}
		sm[v] = add(sm[v], dp[v]);
	}
}

void solve() {
	int n, k;
	cin >> n >> k;
	vector<int> x(k);
	for (int i = 0; i < k; i++) {
		cin >> x[i];
		mp[x[i]] = true;
	}
	p.assign(n + 1, -1);
	g.assign(n + 1, vector<int>());
	for (int i = 2; i <= n; i++) {
		cin >> p[i];
		g[p[i]].push_back(i);
	}
	sz.assign(n + 1, 0);
	dfs(1);
	int ans = 0;
	sort(x.begin(), x.end(), [&](int a, int b) {
		return sz[a] < sz[b];
		});

	dp.assign(n + 1, 0);
	sm.assign(n + 1, 0);
	dfsd(1);
	cout << dp[x[0]];
}

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