#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

double pi = 3.141592653589793238;
const ll LL_INF_BIG = 1e18 + 7;
const ll LL_INF = 1e9 + 7;
const int INF = 1e9 + 7;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

template <class T> void chmin(T& a, T b) {
    if (a > b) a = b;
    return;
}

template <class T> void chmax(T& a, T b) {
    if (a < b) a = b;
    return;
}

vector<pair<ll, ll>> prime_factorize(ll N) {
    vector<pair<ll, ll>> res;
    for (ll i = 2; i * i <= N; i++) {
        if (N % i != 0) continue;
        ll exp = 0;
        while (N % i == 0) {
            exp++;
            N /= i;
        }
        res.push_back({i, exp});
    }
    if (N != 1) res.push_back({N, 1});
    return res;
}

ll mod_pow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

struct UnionFind {
    vector<int> parents, siz;

    UnionFind(int N) : parents(N, -1), siz(N, 1) {}

    int root(int x) {
        if (parents.at(x) == -1) return x;
        return parents.at(x) = root(parents.at(x));
    }

    bool unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return false;
        if (siz.at(rx) > siz.at(ry)) swap(rx, ry);
        parents.at(rx) = ry;
        // Update the size only at root.
        siz.at(ry) += siz.at(rx);
        return true;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }

    // If the size is needed, we need to see it at root.
    int size(int x) { return siz.at(root(x)); }
};

// struct Edge {
//     ll to;
//     ll weight;
//     Edge(ll t, ll w) : to(t), weight(w) {}
// };

using Edge = pair<int, pair<int, int>>;

using Graph = vector<vector<Edge>>;

Graph G;

vector<Edge> edge;

int N, M;
vector<int> A;

ll answer = 0;
vector<int> answers;
vector<int> intervals;

void input() {
    cin >> N >> M;
    A.resize(M);
    for (int i = 0; i < M; i++) {
        int a;
        cin >> a;
        // a--;
        A.at(i) = a;
    }
}

void solve() {
    if(M==0) {
        answer = 1;
        return;
    }
    sort(A.begin(), A.end());
    int minInterval = INF;
    int firstInterval = A.at(0)-1;
    if (firstInterval > 0) {
        chmin(minInterval, firstInterval);
        intervals.push_back(firstInterval);
    }
    for (int i = 1; i < M; i++) {
        int ival = A.at(i) - A.at(i - 1) - 1;
        if (ival == 0) continue;
        chmin(minInterval, ival);
        intervals.push_back(ival);
    }
    int lastInterval = N - A.at(M - 1);
    if (lastInterval > 0) {
        chmin(minInterval, lastInterval);
        intervals.push_back(lastInterval);
    }

    int k;
    k = minInterval;
    for (int i = 0; i < intervals.size(); i++) {
        if (intervals.at(i) % k == 0) {
            answer += intervals.at(i) / k;
        } else {
            answer += intervals.at(i) / k;
            answer++;
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    input();
    solve();
    // cout << fixed << setprecision(3);
    cout << answer << "\n";
    // for (auto answer : answers) cout << answer << "\n";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

template <int mod>
class Modint {
    using mint = Modint;
    static_assert(mod > 0, "Modulus must be positive");

public:
    static constexpr int get_mod() noexcept { return mod; }

    constexpr Modint(long long y = 0) noexcept : x(y >= 0 ? y % mod : (y % mod + mod) % mod) {}

    constexpr int value() const noexcept { return x; }

    constexpr mint& operator+=(const mint& r) noexcept { if ((x += r.x) >= mod) x -= mod; return *this; }
    constexpr mint& operator-=(const mint& r) noexcept { if ((x += mod - r.x) >= mod) x -= mod; return *this; }
    constexpr mint& operator*=(const mint& r) noexcept { x = static_cast<int>(1LL * x * r.x % mod); return *this; }
    constexpr mint& operator/=(const mint& r) noexcept { *this *= r.inv(); return *this; }

    constexpr mint operator-() const noexcept { return mint(-x); }

    constexpr mint operator+(const mint& r) const noexcept { return mint(*this) += r; }
    constexpr mint operator-(const mint& r) const noexcept { return mint(*this) -= r; }
    constexpr mint operator*(const mint& r) const noexcept { return mint(*this) *= r; }
    constexpr mint operator/(const mint& r) const noexcept { return mint(*this) /= r; }

    constexpr bool operator==(const mint& r) const noexcept { return x == r.x; }
    constexpr bool operator!=(const mint& r) const noexcept { return x != r.x; }

    constexpr mint inv() const noexcept {
        int a = x, b = mod, u = 1, v = 0;
        while (b > 0) {
            int t = a / b;
            std::swap(a -= t * b, b);
            std::swap(u -= t * v, v);
        }
        return mint(u);
    }

    constexpr mint pow(long long n) const noexcept {
        mint ret(1), mul(x);
        while (n > 0) {
            if (n & 1) ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }

    friend std::ostream& operator<<(std::ostream& os, const mint& r) {
        return os << r.x;
    }

    friend std::istream& operator>>(std::istream& is, mint& r) {
        long long t;
        is >> t;
        r = mint(t);
        return is;
    }

private:
    int x;
};

using mint = Modint<998244353>;


template <typename T>
class Combination {
public:
    Combination() = default;
    Combination(int n) : fact(n + 1), fact_inv(n + 1) {
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
        fact_inv[n] = T(1) / fact[n];
        for (int i = n; i > 0; --i) fact_inv[i - 1] = fact_inv[i] * i;
    }

    T perm(int n, int r) const {
        if (r < 0 || n < r) return 0;
        return fact[n] * fact_inv[n - r];
    }

    T comb(int n, int r) const {
        if (r < 0 || n < r) return 0;
        return fact[n] * fact_inv[r] * fact_inv[n - r];
    }

private:
    std::vector<T> fact, fact_inv;
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N, K;
    cin >> N >> K;
    vector<vector<mint>> A(K + 1, vector<mint>(N, 1));
    for (int i = 0; i < N; ++i) cin >> A[1][i];
    for (int i = 2; i <= K; ++i) {
        for (int j = 0; j < N; ++j) {
            A[i][j] = A[i - 1][j] * A[1][j];
        }
    }
    vector<mint> sum(K + 1);
    for (int i = 0; i <= K; ++i) {
        for (int j = 0; j < N; ++j) sum[i] += A[i][j];
    }
    vector<mint> pow2(K + 1, 1);
    for (int i = 1; i <= K; ++i) pow2[i] = pow2[i-1] * 2;
    Combination<mint> comb(K + 1);
    for (int X = 1; X <= K; ++X) {
        mint ans = 0;
        for (int i = 0; i <= X; ++i) ans += comb.comb(X, i) * sum[i] * sum[X - i];
        ans -= pow2[X] * sum[X];
        ans /= 2;
        cout << ans << "\n";
    }
}