#include <iostream>
#include <vector>
#include <map>
#include <random>
using namespace std;
using ll = long long;
using ull = unsigned long long;


#define all(v) begin(v), end(v)
#define rall(v) rbegin(v), rend(v)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ROF(i, a, b) for(ll i = b; i >= a; --i)

mt19937 rnd(42);
mt19937_64 rnd64(52);

const int N = 501;
const int mod = 998244353;

vector<int> g[N];

ll dp[N][N];
bool is[N];
ll sz[N];

void add(ll&a,ll b) {
    a += b;
    if (a >= mod) a -= mod;
}
void mul(ll&a, ll b) {
    a = a * b % mod;
}
ll binpow(ll a, ll n) {
    if (n == 0) return 1;
    ll d = binpow(a , n / 2);
    if (n % 2 == 0) return d * d % mod;
    return d * d % mod * a % mod;
}
vector<ll> vec;
ll dfs2(ll v) {
    if (is[v]) {
        vec.push_back(v);
        return 0;
    }
    ll ans = 0;
    for (auto& u : g[v]) {
        ans += dfs2(u);
    }
    return ans;
}
ll ans;
void dfs(ll v) {
    sz[v] = 1;
    ll cnt = 0;
    for (auto& u : g[v]) {
        dfs(u);
        sz[v] += sz[u];
        cnt++;
    }
    if (is[v]) {
        ans = binpow(2, sz[v]);
        for (auto& u : g[v]) {
            ans = (ans - binpow(2, sz[u]) + 1 + mod) % mod;
        }
        ans = (ans - 1 + mod) % mod;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ll n, k;
    cin >> n >> k;
    vector<ll> v(k);
    for (ll i = 0; i < n - 1; ++i) {
        ll p; cin >> p;
        g[p - 1].push_back(i + 1);
    }
    for (ll i = 0; i < k; ++i) {
        ll x; cin >> x;
        is[x - 1] = true;
    }
    dfs(0);
    cout << ans;
}