#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <iomanip>
using namespace std;
using ll = long long;
using ld = long double;
#define endl '\n'
const int mod = 998244353;
vector<vector<int>> g;
vector<bool> mt;
vector<vector<int>> dp; vector<int> sz;
int pw(int x, int k) {
	int ans = 1;
	while (k) {
		if (k & 1) ans = (ans * 1ll * x) % mod;
		x = (x * 1ll * x) % mod; k >>= 1;
	}
	return ans;
}
void dfs(int v) {
	sz[v] = 1;
	for (auto to : g[v]) {
		dfs(to); sz[v] += sz[to];
	}
	dp[v].resize(sz[v] + 1, 0);
	sort(g[v].begin(), g[v].end(), [&](int a, int b) {
		return sz[a] < sz[b];
	});
	if (mt[v]) {
		int ans = (pw(2, sz[v]) + mod - 1) % mod;
		for (auto to : g[v]) {
			ans = (ans + mod + 1 - pw(2, sz[to])) % mod;
		}
		cout << ans; exit(0);
	}
}
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, k; cin >> n >> k; mt.resize(n, 0); g.resize(n);
	for (int i = 0; i < k; i++) {
		int v; cin >> v; mt[v - 1] = 1;
	}
	for (int i = 1; i < n; i++) {
		int p; cin >> p; g[p - 1].push_back(i);
	}
	dp.resize(n); sz.resize(n); dfs(0);
	int ans = 0;
	for (int i = 0; i <= n; i++) ans = (ans + dp[0][i]) % mod;
	cout << ans;
	return 0;
}
