#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define f first
#define s second
#define ll long long
#define ld long double

using namespace std;

int mod = 998244353;

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

signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0); cin.tie(0);
    int t = 1; // cin >> t;
    while (t--) solve();
}