#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>


// order_of_key
// find_by_order
using namespace __gnu_pbds;
using namespace std;
using ll = long long;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll mod = 998 244 353;


ll bin_pow(ll n, ll st) {
	if (st == 0) {
		return 1;
	}

	if (st % 2 == 0) {
		ll rs = bin_pow(n, st / 2);
		return (rs * rs) % mod;
	} else {
		ll rs = bin_pow(n, st / 2);
		return (((rs * rs) % mod) * n) % mod;
	}
}






int main() {
	ios::sync_with_stdio(0); cin.tie(0);


	ll n, k; cin >> n >> k;
	vector <ll> x(k);
	for (auto &el : x) cin >> el;


	for (ll i = 0; i < n - 1; i++) {
		ll y; cin >> y;
	}



	ll ans = 1;


	for (ll i = 1; i <= n; i++) {
		ans *= bin_pow(2, (n - i));
		ans %= mod;
	}

	cout << ans << endl;
}



