#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

using namespace std;
using ll = long long;

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

template<typename T, typename Y>
istream &operator>>(istream &in, pair<T, Y> &a) {
    return in >> a.first >> a.second;
}

template<typename T, typename Y>
ostream &operator<<(ostream &out, const pair<T, Y> &a) {
    return out << a.first << ' ' << a.second;
}

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

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &a) {
    for (const auto &i : a) {
        out << i << ' ';
    }
    return out;
}

template<typename T>
void print(const vector<T> &a, string c = "\n") {
    for (const auto &i : a) {
        cout << i << c;
    }
}

const ll MOD = 998244353;

struct MyInt {
    int x;

    MyInt(ll x0 = 0) {
        if (x0 < 0) {
            x0 += MOD;
        }
        if (x0 >= MOD) {
            x0 %= MOD;
        }
        x = x0;
    }

    MyInt operator+(const MyInt &b) const {
        ll x1 = x + b.x;
        if (x1 >= MOD) {
            x1 -= MOD;
        }
        return {x1};
    }

    MyInt operator-(const MyInt &b) const {
        ll x1 = x - b.x;
        if (x1 < 0) {
            x1 += MOD;
        }
        return {x1};
    }

    MyInt operator*(const MyInt &b) const {
        return {(ll) x * b.x % MOD};
    }
};

MyInt binpow(MyInt a, ll x) {
    if (x == 0) {
        return 1;
    }
    if (x & 1) {
        return binpow(a, x - 1) * a;
    }
    MyInt h = binpow(a, x / 2);
    return h * h;
}

const int MAXN = 1e6 + 1;
vector<ll> g[MAXN];
ll p[MAXN], sz[MAXN], f[MAXN], need[MAXN];
MyInt dp[MAXN];

MyInt ans = 0;

void dfs(int v, int p) {
    sz[v] = 1;
    need[v] += f[v];
    for (auto u : g[v]) {
        if (u != p) {
            dfs(u, v);
            sz[v] += sz[u];
            need[v] += need[u];
        }
    }
    if (f[v]) {
        ans = ans + binpow(2, sz[v]);
        for (auto u : g[v]) {
            ans = ans - binpow(2, sz[u]);
        }
    }
}

void solve() {
    ll n, k;
    cin >> n >> k;
    for (int i = 0; i < k; ++i) {
        int x;
        cin >> x;
        f[x] = 1;
    }
    p[1] = 1;
    for (int i = 2; i <= n; ++i) {
        cin >> p[i];
        g[p[i]].push_back(i);
    }
    dfs(1, 1);
    cout << (ans.x + MOD * MOD) % MOD;
}

int main() {
#ifdef LOCAL
    freopen("inp.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("err.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int times = 1;
    // cin >> times;
    while (times--) {
        solve();
        cout << '\n';
    }
}
