#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

const int MAXN = 1e6 + 1;

const int MOD = 998244353;
int add(int a, int b) { return (a + b) % MOD; }
int sub(int a, int b) { return (a - b + MOD) % MOD; }
int mul(int a, int b) { return (1LL * a * b) % MOD; }
int bin_pow(int a, int n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        int x = bin_pow(a, n / 2);
        return mul(x, x);
    } else {
        return mul(a, bin_pow(a, n - 1));
    }
}


vector<int> g[MAXN];
int subt_size[MAXN];

void dfs(int v) {
    subt_size[v] = 1;
    for (int u : g[v]) {
        dfs(u);
        subt_size[v] += subt_size[u];
    }
}

int main() {
    #ifdef LOCAL
    freopen("_test.in", "r", stdin);
    freopen("_test.out", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cout << (1 << 20);
    return 0;

    int n, k;
    cin >> n >> k;

    vector<int> x(k);
    for (int i = 0; i < k; i++) cin >> x[i];
    
    for (int i = 2; i <= n; i++) {
        int p;
        cin >> p;
        g[p].push_back(i);
    }

    dfs(1);

    int res = 0;

    res = bin_pow(2, subt_size[x[0]] - 1);
    
    int cur = 1, rem = 1;
    for (int u : g[x[0]]) {
        cur =  mul(cur, subt_size[u] + 1);
        rem = add(rem, subt_size[u]);
    }
    cur = sub(cur, rem);

    cout << add(res, cur);
}