#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
using ll = long long;

template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const ll mod = 998'244'353;

ll binpow(ll a, ll b) {
    ll res = 1;
    for (int i = 0; i < 28; i++, a = a * a % mod) {
        if ((b >> i) & 1) {
            res = res * a % mod;
        }
    }
    return res;
}

int n, k;
vector <int> x, p, sz;
vector <vector <int>> g;

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

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n >> k;
    x.resize(k);
    p.resize(n);
    sz.resize(n);
    g.resize(n);

    for (int i = 0; i < k; i++) {
        cin >> x[i];
        x[i]--;
    }

    for (int i = 1; i < n; i++) {
        cin >> p[i];
        p[i]--;

        g[p[i]].push_back(i);
    }

    get_sz(0);
    ll ans = binpow(2, sz[x[0]]) - 1;

    for (auto u : g[x[0]]) {
        ans = (ans - binpow(2, sz[u]) + 1 + mod) % mod;
    }

    cout << ans << '\n';
}
