#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10, base = 10, M = 998244353, lg = 21, size = 1 << lg;
int n, k, A[size], rev[size];
int B[size];
int power(int a, int b) {
  int ans = 1;
  while (b > 0) {
    if (b & 1) {
      ans = 1ll * ans * a % M;
    }
    a = 1ll * a * a % M;
    b >>= 1;
  }
  return ans;
}
struct FFT {
  void ntt(int A[], int inv) {
    for (int i = 0; i < size; i++) {
      rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (lg - 1));
      if (rev[i] < i) {
        swap(A[rev[i]], A[i]);
      }
    }
    for (int len = 1; len < size; len <<= 1) {
      int wn = power(3, (M - 1) / (len << 1));
      if (inv == -1) {
        wn = power(wn, M - 2);
      }
      for (int i = 0; i < size; i += len << 1) {
        int ww = 1;
        for (int j = 0; j < len; j++) {
          int a = 1ll * ww * A[i + j + len] % M;
          A[i + j + len] = (A[i + j] - a + M) % M;
          A[i + j] = (A[i + j] + a) % M;
          ww = 1ll * ww * wn % M;
        }
      }
    }
    if (inv == -1) {
      int sinv = power(size, M - 2);
      for (int i = 0; i < size; i++) {
        A[i] = 1ll * A[i] * sinv % M;
      }
    }
  }
  void mul(int A[], int B[], int C[]) {
    for (int i = 0; i < size; i++) {
      A[i] = 1ll * B[i] * C[i] % M;
    }
    ntt(A, -1);
  }
} ntt;
int32_t main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < k; i++) {
    int a;
    scanf("%d", &a);
    A[a]++;
  }
  ntt.ntt(A, +1);
  for (int i = 0; i < size; i++) {
    A[i] = power(A[i], n / 2);
  }
  ntt.ntt(A, -1);
  int ans = 0;
  for (int i = 0; i < size; i++) {
    ans = (ans + 1ll * A[i] * A[i] % M) % M;
  }
  printf("%d\n", ans);
}
