#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

const int MOD = 998244353;
const int Inf = 2e9;
const ll INF = 3e18;

vector <vector <int>> g;
vector <int> sz;

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

int binpow(int a, int b) {
  if (b == 0) return 1;
  ll k = binpow(a, b/2);
  if (b % 2 == 0) return k * k % MOD;
  else return k * k % MOD * a % MOD;
}

int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  sz.resize(n, 1);
  g.resize(n);
  vector <int> x(k);
  for (int i = 0; i < k; i++) {
    cin >> x[i]; x[i]--;
  }
  for (int i = 1; i < n; i++) {
    int p; cin >> p; p--;
    g[p].push_back(i);
  }
  dfs(0);
  int v = x[0];
  int ans = (binpow(2, sz[v]) - 1 + MOD) % MOD;
  for (int u : g[v]) {
    ans = ((ans - binpow(2, sz[u]) + 1) % MOD + MOD) % MOD;
  }
  cout << ans << '\n';
  return 0;
}