#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long p, long long mod) {
  if (p == 0) return 1;
  long long ans = power(a, p / 2, mod);
  ans = (ans * ans) % mod;
  if (p % 2) ans = (ans * a) % mod;
  return ans;
}
int primitive_root(int p) {
  vector<int> factor;
  int phi = p - 1, n = phi;
  for (int i = 2; i * i <= n; ++i)
    if (n % i == 0) {
      factor.push_back(i);
      while (n % i == 0) n /= i;
    }
  if (n > 1) factor.push_back(n);
  for (int res = 2; res <= p; ++res) {
    bool ok = true;
    for (int i = 0; i < factor.size() && ok; ++i)
      ok &= power(res, phi / factor[i], p) != 1;
    if (ok) return res;
  }
  return -1;
}
int nttdata(int mod, int &root, int &inv, int &pw) {
  int c = 0, n = mod - 1;
  while (n % 2 == 0) c++, n /= 2;
  pw = (mod - 1) / n;
  int g = primitive_root(mod);
  root = power(g, n, mod);
  inv = power(root, mod - 2, mod);
  return c;
}
struct NTT {
  int N;
  vector<int> perm;
  int mod, root, inv, pw;
  NTT(int mod, int root, int inv, int pw)
      : mod(mod), root(root), inv(inv), pw(pw) {}
  void precalculate() {
    perm.resize(N);
    perm[0] = 0;
    for (int k = 1; k < N; k <<= 1) {
      for (int i = 0; i < k; i++) {
        perm[i] <<= 1;
        perm[i + k] = 1 + perm[i];
      }
    }
  }
  void fft(vector<int> &v, bool invert = false) {
    if (v.size() != perm.size()) {
      N = v.size();
      assert(N && (N & (N - 1)) == 0);
      precalculate();
    }
    for (int i = 0; i < N; i++)
      if (i < perm[i]) swap(v[i], v[perm[i]]);
    for (int len = 2; len <= N; len <<= 1) {
      int factor = invert ? inv : root;
      for (int i = len; i < pw; i <<= 1) factor = (1LL * factor * factor) % mod;
      for (int i = 0; i < N; i += len) {
        int w = 1;
        for (int j = 0; j < len / 2; j++) {
          int x = v[i + j], y = (1LL * w * v[i + j + len / 2]) % mod;
          v[i + j] = (x + y) % mod;
          v[i + j + len / 2] = (x - y + mod) % mod;
          w = (1LL * w * factor) % mod;
        }
      }
    }
    if (invert) {
      long long n1 = power(N, mod - 2, mod);
      for (int &x : v) x = (1LL * x * n1) % mod;
    }
  }
  void multiply(vector<int> &a, vector<int> b) {
    int n = 1;
    while (n < a.size() + b.size()) n <<= 1;
    a.resize(n);
    b.resize(n);
    fft(a);
    fft(b);
    for (int i = 0; i < n; i++) a[i] = (1LL * a[i] * b[i]) % mod;
    fft(a, true);
  }
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int mod = 998244353;
  int root = 15311432, inv = 469870224, pw = 1 << 23;
  int l = nttdata(mod, root, inv, pw);
  NTT ntt(mod, root, inv, pw);
  vector<int> cur(10, 0), nxt;
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= k; i++) {
    int x;
    cin >> x;
    cur[x] = 1;
  }
  nxt = cur;
  int lagbe = n / 2 - 1;
  while (lagbe) {
    if (lagbe & 1) ntt.multiply(nxt, cur);
    ntt.multiply(cur, cur);
    while (nxt.back() == 0) nxt.pop_back();
    while (cur.back() == 0) cur.pop_back();
    lagbe >>= 1;
  }
  long long ans = 0;
  for (int i = 0; i < nxt.size(); i++)
    ans = (ans + 1LL * nxt[i] * nxt[i]) % mod;
  printf("%lld\n", ans);
}
