#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <array>
using namespace std;
using ll = long long;
#define all(x) x.begin(),x.end()

vector<vector<int>> g;

const ll M = 998244353;
ll bp(ll val, ll n) {
	if (n == 0) {
		return 1;
	}
	ll ans = bp(val, n / 2);
	ans = ans * ans % M;
	if (n & 1) ans = ans * val % M;
	return ans;
}

vector<int> sz;
void dfs(int u) {
	sz[u] = 1;
	for (auto i : g[u]) {
		dfs(i);
		sz[u] += sz[i];
	}
}



void solve() {
	int n, k;
	cin >> n >> k;
	sz.resize(n);
	g.resize(n);
	int x;
	for (int i = 0; i < k; i++)
	{
		cin >> x;
	}
	--x;
	for (int i = 1; i < n ; i++)
	{
		int p;
		cin >> p;
		g[p - 1].push_back(i);
	}
	dfs(0);
	ll ans = bp(2,sz[x]);
	for (auto i : g[x]) {
		ans = ans - bp(2, sz[i]) + 1;
	}
	ans -= 1;
	ans %= M;
	ans += M;
	ans %= M;
	cout << ans;
}

int main()
{
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif // _DEBUG
	ios::sync_with_stdio(0);
	cin.tie(0);
	solve();
}

