#include <iostream>
#include <vector>
#include <set>
#include <iomanip>
#include <map>
#include <random>
#include <ctime>
#include <algorithm>
#include <ctime>
#include <unordered_map>
#include <cmath>
#include <cstring>
#include <numeric>
#include <deque>

using namespace std;
using ll = long long;

ll mod = 998244353;

struct mll {
    ll val;
};

mll operator+ (mll a, mll b) {
    if (a.val+b.val > mod) return {a.val+b.val-mod};
    return {a.val+b.val};
}

mll operator- (mll a, mll b) {
    if (a.val-b.val < 0) return {a.val-b.val+mod};
    return {a.val-b.val};
}

mll operator* (mll a, mll b) {
    return {a.val*b.val%mod};
}

mll bin_up(mll a, ll b) {
    if (b == 1) {
        return a;
    }
    if (b == 0) {
        return {1};
    }
    if (b%2 == 1) {
        mll x = bin_up(a, b/2);
        return x*x*a;
    } else {
        mll x = bin_up(a, b/2);
        return x*x;
    }
}

vector <ll> p;
vector <vector <ll>> sn;
vector <ll> sz;

void dfs(int a) {
    for (auto b : sn[a]) {
        dfs(b);
        sz[a] += sz[b];
    }
    return;
}

int main() {
    ll n, k;
    cin >> n >> k;
    p.resize(n);
    sn.resize(n);
    sz.resize(n, 1);
    vector <ll> mas(k);
    for (int i = 0; i < k; ++i) cin >> mas[i];
    for (int i = 1; i < n; ++i) {
        cin >> p[i];
        p[i]--;
        sn[p[i]].push_back(i);
    }
    dfs(0);
    mll ans = bin_up({2}, sz[mas[0]-1]-1);
    mll ans1 = {0};
    for (auto b : sn[mas[0]-1]) {
        mll x = bin_up({2}, sz[b]);
        mll s = {1};
        x = x - s;
        ans1 = ans1 + x;
    }
    mll c = {1};
    mll d = {2};
    ans = ans*d;
    ans = ans-c-ans1;
    cout << ans.val << '\n';
}