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

using namespace std;
using namespace __gnu_pbds;

using ll=long long;
#define int ll

#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()

const int MOD = 998244353;

void solve() {
    int n, k;
    cin >> n >> k;
    int cnt = 1;
    vector<int> f(n);
    for (int i = 0; i < k; i++) {
        int x;
        cin >> x;
        x--;
        f[x]++;
    }
    int ans = 1;
    for (int i = 0; i < n; i++) {
        if (f[i]) {
            cnt++;
            continue;
        }
        ans = (ans * cnt) % MOD;
    }
    cout << ans << "\n";
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
}
