#include <bits/stdc++.h>
//#include <bits/extc++.h>
using namespace std;
//using namespace __gnu_pbds;
using ll = long long;
using ld = long double;
using pii = pair<ll, ll>;
using pic = pair<ll, char>;
using ull = unsigned long long;
//using oset = tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937 rnd('S' + 'E' + 'E' + 'D');
ll l_r(const ll &lb_, const ll &rb_) {return (lb_ + rnd() % (rb_ - lb_ + 1)); }
template<class T> ll szl(const T &v1) { return (ll)v1.size(); }
template<class T> bool mmin(T &v1, const T &v2) { return (v1 > v2 ? v1 = v2, 1 : 0); }
template<class T> bool mmax(T &v1, const T &v2) { return (v1 < v2 ? v1 = v2, 1 : 0); }
#ifndef MiracleFFT
    #pragma GCC optimize("O3,unroll-loops")
    #pragma GCC target("avx,avx2,bmi,bmi2,lzcnt,popcnt")
#endif
const ll INF = 2e9 + 10;
const ll LNF = 2e18 + 10;
const ll MAXN = 1e6 + 10;
const ll MAXX = 1e9 + 10;
const ll MAXC = 1e18 + 10;
const ll ALPH = 26;
const ll BL_SZ = 400;
const ll MAX_LOG = 20;
const ll CNT_OP = 100;
const ll MOD = 998244353;
const ll P = 179;
const ll M = 1e9 + 787;
const ld UNO = ld(1.0);
const ld PI = atan2(0, -1);
const ld BURN = ld(0.99999);

ll p2[MAXN];
void prep() {
    p2[0] = 1;
    for (ll i = 1; i < MAXN; i++) {
        p2[i] = (p2[i - 1] * 2) % MOD;
    }
}

ll n, k, s;
vector<ll> is_g, sz;
vector<vector<ll>> g;

void dfs(ll v) {
    sz[v] = 1;
    for (auto &u : g[v]) {
        dfs(u);
        sz[v] += sz[u];
    }

    if (is_g[v]) {
        s = (s + p2[sz[v] - 1] + MOD - 1) % MOD;
        for (auto &u : g[v]) {
            ll x = (p2[sz[u]] + MOD - 1) % MOD;
            s = (s + MOD - x) % MOD;
        }
        s = (s + p2[sz[v] - 1]) % MOD;
    }
}

void solve() {
    cin >> n >> k;
    is_g.assign(n, 0);
    while (k--) {
        ll v;
        cin >> v;
        --v;
        is_g[v] = 1;
    }

    sz.assign(n, 0);
    g.assign(n, {});
    for (ll i = 1; i < n; i++) {
        ll p;
        cin >> p;
        --p;
        g[p].push_back(i);
    }

    s = 0;
    dfs(0);
    cout << s << '\n';
}


int main() {
    bool IS_MULTITEST = 0; 
    #ifdef MiracleFFT
        IS_MULTITEST = 1;
        freopen("ain.txt", "r", stdin);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << setprecision(9) << fixed;
    prep();
    ll t = 1;
    if (IS_MULTITEST) {
        cin >> t;
    }
    while (t--) {
        solve();
    }
    #ifdef MiracleFFT
        cout << setprecision(2) << fixed;
        cout << "Time: " << ((ld)clock() / CLOCKS_PER_SEC) << " Sec" << endl;
    #endif
}
