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

#define int long long
#define db double
#define ll long long
#define pii pair<int, int>
#define tiii tuple<int ,int, int >
#define tiiii tuple<int, int, int, int>
#define tiiiii tuple<int, int, int, int, int>
#define ve vector
#define vi ve<int>
#define vvi ve<vi>
#define all(a) a.begin(), a.end()
#define allr(a) a.rbegin(), a.rend()
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define cin(a) for(auto &now : a) cin >> now;
#define print(a, s) for(auto now : a) cout << now << s;
template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937 rnd(time(0));
const int N = 1e6 + 10;
const int M = 998244353;
int st(int a, int n) {
    if (n == 0) return 1;
    return (n % 2 == 0 ? st(a * a % M, n / 2) : a * st(a, n - 1) % M);
}
vi g[N];
void solve() {
    int n, k; cin >> n >> k;
    vi x(k); cin(x);
    for (int i= 0 ;  i < k; ++i) --x[i];
    //x.push_back(-1);
    sort(all(x)); x.push_back(n);

    int ans = 1;
    for (int i = 0; i < k; ++i) {
        ans *= (st(i + 2, x[i + 1] - x[i] - 1));
    }
    cout << ans;

}
int32_t main() {
    // ios::sync_with_stdio(0);
    // cin.tie(0); cout.tie(0);
    cout << fixed << setprecision(9);

    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}


