#include <bits/stdc++.h>

using namespace std;

long long mod = 998244353;

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	long long n, k;
	cin >> n >> k;
	vector<long long> a(k);
	for (long long i = 0; i < k; ++i) {
        cin >> a[i];
        a[i]--;
	}
	sort(a.begin(), a.end());
	long long ind = 0, ans = 1;
	for (long long i = 0; i < n; ++i) {
        if (ind < k && a[ind] == i) {
            ind++;
        } else {
            ans *= (ind + 1);
            ans %= mod;
        }
	}
	cout << ans << '\n';
}
