#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e6 + 5;
int mod = 998244353;
const double PI = acos(-1);
int n, k;
int d[14];
const int MOD = 998244353;
long long w[2][3000005];
inline long long qp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return ans;
}
int K;
inline void fftinit(int n) {
  for (K = 1; K < n; K <<= 1)
    ;
  w[0][0] = w[0][K] = 1;
  long long g = qp(3, (MOD - 1) / K);
  for (int i = 1; i < K; i++) w[0][i] = w[0][i - 1] * g % MOD;
  for (int i = 0; i <= K; i++) w[1][i] = w[0][K - i];
}
inline void fft(int* x, int v) {
  for (int i = 0; i < K; i++) x[i] = (x[i] % MOD + MOD) % MOD;
  for (int i = 0, j = 0; i < K; i++) {
    if (i > j) swap(x[i], x[j]);
    for (int l = K >> 1; (j ^= l) < l; l >>= 1)
      ;
  }
  for (int i = 2; i <= K; i <<= 1)
    for (int l = 0; l < i >> 1; l++) {
      register int W = w[v][K / i * l], *p = x + l + (i >> 1), *q = x + l, t;
      for (register int j = 0; j < K; j += i) {
        p[j] = (q[j] - (t = (long long)p[j] * W % MOD) < 0) ? (q[j] - t + MOD)
                                                            : (q[j] - t);
        q[j] = (q[j] + t - MOD >= 0) ? (q[j] + t - MOD) : (q[j] + t);
      }
    }
  if (!v) return;
  long long rv = qp(K, MOD - 2);
  for (int i = 0; i < K; i++) x[i] = x[i] * rv % MOD;
}
vector<int> operator*(vector<int> a, vector<int> b) {
  if (a.size() && b.size())
    ;
  else
    return vector<int>();
  static int aa[3000005], bb[3000005];
  fftinit(a.size() + b.size());
  for (int i = 0; i < K; ++i) aa[i] = bb[i] = 0;
  for (int i = 0; i < int(a.size()); ++i) aa[i] = a[i];
  for (int i = 0; i < int(b.size()); ++i) bb[i] = b[i];
  fft(aa, 0);
  fft(bb, 0);
  for (int i = 0; i < K; ++i) aa[i] = (long long)aa[i] * bb[i] % MOD;
  vector<int> v;
  fft(aa, 1);
  for (int i = 0; i < int(a.size()) + int(b.size()) - 1; ++i)
    v.push_back(aa[i]);
  return v;
}
vector<int> operator+(vector<int> a, vector<int> b) {
  vector<int> s(max(a.size(), b.size()));
  for (int i = 0; i < int(a.size()); ++i) (s[i] += a[i]) %= MOD;
  for (int i = 0; i < int(b.size()); ++i) (s[i] += b[i]) %= MOD;
  return s;
}
vector<int> solve(int sz) {
  vector<int> res((sz * 9) + 1, 0);
  if (sz == 0) return res;
  if (sz == 1) {
    for (int i = 1; i <= k; i++) res[d[i]] = 1;
    return res;
  }
  int h1, h2;
  h1 = sz / 2;
  h2 = sz - h1;
  vector<int> v1, v2;
  v1 = solve(h1);
  v2 = solve(h2);
  res = v1 * v2;
  return res;
}
long long ans;
vector<int> poly;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (int i = 1; i <= k; i++) cin >> d[i];
  n /= 2;
  poly = solve(n);
  for (int i = 0; i < poly.size(); i++) {
    long long x = (1LL * poly[i] * poly[i]) % mod;
    ans = (ans + x) % mod;
  }
  cout << ans << endl;
  return 0;
}
