#include <bits/stdc++.h>
using namespace std;
unsigned fr[1 << 21], fs;
unsigned long long inv(unsigned long long x) {
  return x == 1
             ? 1
             : ((inv(998244353 % x) * (998244353 - 998244353 / x) + 998244353) %
                998244353);
}
unsigned long long qmpow(unsigned long long w, unsigned long long x) {
  unsigned long long r = 1;
  for (unsigned long long i = 1; i && i <= x;
       i <<= 1, w = ((w * w + 998244353) % 998244353))
    if (i & x) r = ((r * w + 998244353) % 998244353);
  return r;
}
void init(unsigned s) {
  for (fs = 1; fs <= s; fs <<= 1)
    ;
  for (int i = 0; i != fs; ++i)
    fr[i] = (fr[i >> 1] >> 1) | (i & 1 ? (fs >> 1) : 0);
}
void ntt(unsigned long long* p, int f) {
  static const unsigned long long g = 3;
  for (int i = 0; i != fs; ++i)
    if (i < fr[i]) swap(p[i], p[fr[i]]);
  for (int i = 1; i != fs; i <<= 1) {
    unsigned long long e = (998244353 - 1) / (i << 1),
                       w0 = qmpow(g, f ? e : 998244353 - 1 - e);
    for (int j = 0; j != fs; j += (i << 1)) {
      unsigned long long w = 1;
      for (int k = 0; k != i; k++, w = ((w * w0 + 998244353) % 998244353)) {
        unsigned long long u = p[j + k],
                           v = ((w * p[i + j + k] + 998244353) % 998244353);
        p[j + k] = ((u + v + 998244353) % 998244353);
        p[i + j + k] = ((u - v + 998244353) % 998244353);
      }
    }
  }
}
void ntt_res(unsigned long long* p) {
  for (unsigned long long i = 0, is = inv(fs); i != fs; ++i)
    p[i] = ((p[i] * is + 998244353) % 998244353);
}
unsigned long long p0[1 << 21];
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  unsigned n, k;
  cin >> n >> k;
  while (k--) {
    unsigned d;
    cin >> d;
    p0[d] = 1;
  }
  init(1 << 21 >> 1);
  ntt(p0, 1);
  for (unsigned i = 0; i != 1 << 21; ++i) p0[i] = qmpow(p0[i], n / 2);
  ntt(p0, 0);
  ntt_res(p0);
  unsigned long long res = 0;
  for (unsigned i = 0; i != 1 << 21; ++i)
    res = ((res + p0[i] * p0[i] + 998244353) % 998244353);
  cout << res << endl;
  return 0;
}
