#pragma gcc optimize("Ofast")
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <random>
#include <bitset>
#include <string>
#include <iomanip>
#include <cmath>

using namespace std;
#define int long long
using ll = long long;
using ld = long double;

#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...)
#endif
vector<vector<int>> g;
vector<int> sz;

void dfs(int v) {
    sz[v] = 1;
    for (int u : g[v]) {
        dfs(u);
        sz[v] += sz[u];
    }
}

const int MOD = 998244353;

int sum(int a, int b) {
    if (a + b < MOD) return a + b;
    return a + b - MOD;
}

int sub(int a, int b) {
    if (a - b >= 0) return a - b;
    return a - b + MOD;
}

int mult(int a, int b) {
    return a * b % MOD;
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int n, k;
    cin >> n >> k;
    vector<int> met(n + 1);
    for (int i = 0; i < k; i++) {
        int x;
        cin >> x;
        met[x] = 1;
    }
    int total = 1, cnt = 0;
    for (int i = 1; i <= n; i++) {
        if (met[i]) {
            cnt++;
            continue;
        }
        total = mult(total, sum(cnt, 1));
    }
    cout << total;
}