#include <bits/stdc++.h>
long long in() {
  char ch;
  long long x = 0, f = 1;
  while (!isdigit(ch = getchar())) (ch == '-') && (f = -f);
  for (x = ch ^ 48; isdigit(ch = getchar());
       x = (x << 1) + (x << 3) + (ch ^ 48))
    ;
  return x * f;
}
using std::vector;
const int mod = 998244353;
const int maxn = 8e6 + 10;
long long ksm(long long x, long long y) {
  long long re = 1LL;
  while (y) {
    if (y & 1) re = re * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return re;
}
int r[maxn], len;
void FNTT(vector<int> &A, int flag) {
  A.resize(len);
  for (int i = 0; i < len; i++)
    if (i < r[i]) std::swap(A[i], A[r[i]]);
  for (int l = 1; l < len; l <<= 1) {
    int w0 = ksm(3, (mod - 1) / (l << 1));
    for (int i = 0; i < len; i += (l << 1)) {
      int w = 1, a0 = i, a1 = i + l;
      for (int k = 0; k < l; k++, a0++, a1++, w = 1LL * w * w0 % mod) {
        int tmp = 1LL * A[a1] * w % mod;
        A[a1] = ((A[a0] - tmp) % mod + mod) % mod;
        A[a0] = (A[a0] + tmp) % mod;
      }
    }
  }
  if (flag == -1) {
    std::reverse(A.begin() + 1, A.end());
    int inv = ksm(len, mod - 2);
    for (int i = 0; i < len; i++) A[i] = 1LL * A[i] * inv % mod;
  }
}
vector<int> operator*(vector<int> A, vector<int> B) {
  int tot = A.size() + B.size() - 1;
  for (len = 1; len <= tot; len <<= 1)
    ;
  for (int i = 0; i < len; i++)
    r[i] = (r[i >> 1] >> 1) | ((i & 1) * (len >> 1));
  FNTT(A, 1), FNTT(B, 1);
  vector<int> ans;
  ans.resize(len);
  for (int i = 0; i < len; i++) ans[i] = 1LL * A[i] * B[i] % mod;
  FNTT(ans, -1);
  ans.resize(tot);
  return ans;
}
vector<int> ksm(vector<int> A, int B) {
  vector<int> ans;
  ans.push_back(1);
  while (B) {
    if (B & 1) ans = ans * A;
    A = A * A;
    B >>= 1;
  }
  return ans;
}
int main() {
  int n = in(), k = in();
  vector<int> ans;
  ans.resize(10);
  for (int i = 1; i <= k; i++) ans[in()] = 1;
  ans = ksm(ans, n >> 1);
  long long tot = 0;
  for (int i = 0; i < (int)ans.size(); i++)
    (tot += 1LL * ans[i] * ans[i] % mod) %= mod;
  printf("%lld\n", tot);
  return 0;
}
