#include <bits/stdc++.h>
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,popcnt")

using namespace std;
#define int long long int
#define fr(i, a, b) for(int i = (a); i <= (b); i++)
#define rf(i, a, b) for(int i = (a); i >= (b); i--)
#define fe(c, a) for (auto& c : a)
#define mk(a, b) make_pair((a), (b))
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
template<typename T>
using v = vector<T>;
using vi = v<int>;
using vvi = v<vi>;
using ii = pair<int, int>;
using vii = v<ii>;
using vvii = v<vii>; 

const int MOD = 998244353;

void solve() {
    int n, k; cin >> n >> k;
    vi a(k); fe(c, a) cin >> c;
    vi dp(k+1, 0); dp[0] = 1;
    int sum = 1;
    sort(rall(a));
    int p = 0;
    rf(j, n, 1) {
        if (j == a[p]) {
            p++;
            if (p == a.size()) {
                cout << sum << '\n';
                return;
            }
            sum = (sum*2)%MOD;
            sum = (sum+MOD-dp[0])%MOD;
            fr(i, 0, k-1) dp[i] = (dp[i] + dp[i+1]) % MOD;
        } else {
            sum = (sum*2) % MOD;
            rf(i, k, 1) {
                dp[i] = (dp[i]+dp[i-1]) % MOD;
            }
        }
    }
    cout << sum << '\n';
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);

    int t = 1; 
    // cin >> t;
    while (t--)
        solve();
}