#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;

// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")

#define int long long
#define ff first
#define ss second
#define endl "\n"
#define all(x) x.begin(), x.end()
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update<>>

const int MOD = 998244353;


void solve() {
    int n, k;
    cin >> n >> k;

    vector<int> x;
    vector<int> isix(n, 0);

    for (int i = 0; i < k; i++) {
        int c;
        cin >> c;
        x.push_back(c - 1);
        isix[c - 1] = 1;
    }

    int ans = 1;

    int curr = 0;

    for (int i = 0; i < n; i++) {
        if (isix[i]) {
            curr++;
            continue;
        }
        ans = (ans * (curr + 1)) % MOD;
    }

    cout << ans << endl;
}


signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    // cin >> t;

    while (t--) {
        solve();
    }
}
