#ifdef LOCAL
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <string>
#include <ctime>
#include <climits>
#include <iomanip>
#include <numeric>
#include <random>
#include <array>
#include <bitset>
#include <unordered_map>
#include <unordered_set>

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")


using ll = long long;
using ld = long double;
using namespace std;

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& p) {
	in >> p.first >> p.second;
	return in;
}

template<typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2>& p) {
	out << p.first << " " << p.second;
	return out;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
	for (auto& el : a) {
		in >> el;
	}
	return in;
}

template<typename T>
ostream& operator<<(ostream& out, vector<T>& a) {
	if (a.empty()) return out;
	out << a[0];
	for (int i = 1; i < (int)a.size(); i++) {
		out << " " << a[i];
	}
	return out;
}

const int INF32 = 1e9;
const ll INF64 = 1e18;
const int mod = 998244353;

int add(int x, int y) {
	if (x + y >= mod) return x + y - mod;
	return x + y;
}

int sub(int x, int y) {
	if (x < y) return x - y + mod;
	return x - y;
}

int mul(int x, int y) {
	return (1ll * x * y) % mod;
}

int bp(int x, int p) {
	if (p == 0) return 1;
	if (p == 1) return x;
	if (p % 2 == 0) {
		return bp(mul(x, x), p / 2);
	} else {
		return mul(x, bp(x, p - 1));
	}
}

vector<int> check;
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];
	}
}

void solve() {
	int n, k;
	cin >> n >> k;
	g.resize(n);
	check.resize(n);
	sz.resize(n);
	for (int i = 0; i < k; i++) {
		int v;
		cin >> v;
		v--;
		check[v] = 1;
	}
	for (int i = 1; i < n; i++) {
		int v;
		cin >> v;
		v--;
		g[v].push_back(i);
	}
	dfs(0);
	int take = 0;
	for (int i = 0; i < n; i++) {
		if (check[i]) {
			take = i;
		}
	}
	int ans = 1;
	for (auto& to : g[take]) {
		ans = mul(ans, sz[to] + 1);
	}
	int v = 1;
	for (auto& to : g[take]) {
		v = mul(v, sz[to] + 1);
	}
	v = sub(v, 1);
	for (auto& to : g[take]) {
		v = sub(v, sz[to]);
	}
	ans = add(ans, v);
	cout << ans;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	ld start_time = clock();
#endif
	solve();
#ifdef LOCAL
	ld finish_time = clock();
	cout << "\n" << "finished in: " << (finish_time - start_time) / CLOCKS_PER_SEC;
#endif
	return 0;
}