#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <iomanip>
#include <deque>
#include <queue>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <random>
using namespace std;

#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
mt19937 rnd(time(0));

const int MOD = 998244353;
int add(int a, int b) {
	a += b;
	if (a >= MOD) {
		a -= MOD;
	}
	return a;
}
int mul(int a, int b) {
	return 1ll * a * b % MOD;
}
int dev(int a, int b) {
	a -= b;
	if (a < 0) {
		a += MOD;
	}
	return a;
}

int bin_pow(int x, int y) {
	if (y == 0) return 1;
	if (y % 2 == 0) {
		int b = bin_pow(x, y / 2);
		return 1ll * b * b % MOD;
	}
	else {
		return 1ll * x * bin_pow(x, y - 1) % MOD;
	}
}
const int maxn = 1e6 + 10;
vector<vector<int>> g(maxn);
vector<int> sz(maxn, 1);

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



void solve() {
	int n, k;
	cin >> n >> k;
	vector<int> ans(k);
	for (int i = 0; i < k; i++) {
		cin >> ans[i];
		ans[i]--;
	}
	for (int i = 1; i < n; i++) {
		int v;
		cin >> v;
		v--;
		g[v].push_back(i);
	}
	dfs(0, -1);
	int v = ans[0];
	int an = bin_pow(2, sz[v]);
	an = dev(an, 1);
	for (int u : g[v]) {
		an = dev(an, bin_pow(2, sz[u]));
		an = add(an, 1);
	}
	cout << an;
}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	solve();
}