#include<bits/stdc++.h>
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
using ll = long long;
//using oset = tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>;


/*
struct segtree{
    vector<ll> tree;
    ll sz;
    ll def = 0;
    ll merg(ll a, ll b) {
        return a + b;
    }
    void clar(ll n) {
        tree.assign(4 * n, def);
        sz = n;
    }
    segtree() {

    }
    void build(ll v, ll l, ll r, vector<ll> & a) {
        if (r - l == 1) {
            tree[v] = a[l];
            return;
        }
        ll m = (l + r) / 2;
        build(v * 2 + 1, l, m, a);
        build(v * 2 + 2, m, r, a);
        tree[v] = merg(tree[v * 2 + 1], tree[v * 2 + 2]);
    }
    segtree(vector<ll> & a) {
        ll n = (ll)a.size();
        clar(n);
        build(0, 0, sz, a);
    }
};
*/

ll mod = 998244353;

ll po(ll x, ll n) {
    if (n == 0) {
        return 1;
    }
    if (n % 2 == 0) {
        ll c = po(x, n / 2);
        return (c * c) % mod;
    } else {
        return (x * po(x, n - 1)) % mod;
    }
}

void solve() {
    ll n, k;
    cin >> n >> k;
    vector<ll> good(n);
    for (ll i = 0; i < k; i++) {
        ll x;
        cin >> x;
        x--;
        good[x] = 1;
    }
    ll ans = 1;
    for (ll i = n - 1; i >= 0; i--) {
        if (!good[i]) {
            ans *= (k + 1);
            ans %= mod;
        } else {
            k--;
        }
    }
    cout << ans << endl;
}

signed main() {
    int MULTITEST = 0;
    #ifdef zapvm
        MULTITEST = 1;
        freopen("in.txt", "r", stdin);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    if (MULTITEST) {
        cin >> t;
    }
    while (t--) {
        solve();
    }
}