#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const long long MO = 998244353;
const long long G = 3;
const long long Inv2 = (MO + 1) / 2;
const bool debug = true;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c;
  T t = 1;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-') {
    t = -1;
    c = getchar();
  }
  do (x *= 10) += (c - '0');
  while ((c = getchar()) >= '0' && c <= '9');
  x *= t;
}
template <typename T, typename... Args>
inline void read(T &x, Args &...args) {
  read(x), read(args...);
}
template <typename T>
inline void write(T x) {
  int len = 0;
  char c[21];
  if (x < 0) putchar('-'), x *= (-1);
  do {
    ++len;
    c[len] = (x % 10) + '0';
  } while (x /= 10);
  for (int i = (len); i >= (1); --i) putchar(c[i]);
}
int d[15], len, rev[1048580];
long long a[1048580], b[1048580];
inline long long fpow(long long n, long long k) {
  long long t = 1;
  while (k) {
    if (k & 1) t = (t * n) % MO;
    n = (n * n) % MO;
    k >>= 1;
  }
  return t;
}
inline void ntt(long long *arr, int f, int n) {
  for (int i = 0; i < n; i++)
    if (i < rev[i]) swap(arr[i], arr[rev[i]]);
  for (int i = 1; i < n; i <<= 1) {
    long long gn = fpow(G, (MO - 1) / (i << 1));
    if (f == -1) gn = fpow(gn, MO - 2);
    for (int j = 0; j < n; j += i << 1) {
      long long w = 1;
      for (int k = 0; k < i; k++) {
        long long x = arr[j + k], y = w * arr[j + k + i] % MO;
        arr[j + k] = (x + y) % MO;
        arr[j + k + i] = (x - y + MO) % MO;
        w = (w * gn) % MO;
      }
    }
  }
}
int k;
int solve(const int &L, const int &R) {
  if (L == R) {
    for (int i = (0); i <= (9); ++i) a[i] = 0;
    for (int i = (1); i <= (k); ++i) a[d[i]] = 1;
    return 9;
  }
  int mid = (L + R) >> 1, m, n;
  n = solve(L, mid);
  if (R - mid - 1 == mid - L) {
    m = n;
    for (int i = (0); i <= (m); ++i) b[i] = a[i];
  } else {
    queue<long long> q;
    for (int i = (0); i <= (n); ++i) q.push(a[i]), a[i] = 0;
    m = solve(mid + 1, R);
    for (int i = (0); i <= (m); ++i) b[i] = a[i];
    for (int i = (0); i <= (n); ++i) a[i] = q.front(), q.pop();
  }
  int n1 = n + 1, m1 = m + 1;
  m += n, len = rev[0] = 0;
  for (n = 1; n <= m; n <<= 1) len++;
  for (int i = (n1); i <= (n); ++i) a[i] = 0;
  for (int i = (m1); i <= (n); ++i) b[i] = 0;
  for (int i = 0; i < n; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((long long)(i & 1) << (len - 1));
  ntt(a, 1, n), ntt(b, 1, n);
  for (int i = 0; i <= n; i++) a[i] = (a[i] * b[i]) % MO;
  ntt(a, -1, n);
  int invn = fpow(n, MO - 2);
  for (int i = 0; i <= m; i++) a[i] = a[i] * invn % MO;
  return m;
}
inline int ac() {
  int n;
  read(n, k);
  for (int i = (1); i <= (k); ++i) read(d[i]);
  n = solve(1, n >> 1);
  long long ans = 0;
  for (int i = (0); i <= (n); ++i) (ans += (a[i] * a[i] % MO)) %= MO;
  write(ans);
  return 0;
}
int main() {
  ac();
  return 0;
}
