#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int N = 1 << 20, mod = 7 * 17 * (1 << 23) + 1, g = 3;
int rev[N], w[N], inv_n;
inline int Pow(int a, int p) {
  int ret = 1;
  while (p) {
    if (p & 1) ret = (long long)ret * a % mod;
    a = (long long)a * a % mod;
    p >>= 1;
  }
  return ret;
}
void prepare(int &n) {
  int sz = 31 - __builtin_clz(n);
  sz = abs(sz);
  int r = Pow(g, (mod - 1) / n);
  inv_n = Pow(n, mod - 2);
  w[0] = w[n] = 1;
  for (int i = 1; i < n; ++i) w[i] = (long long)w[i - 1] * r % mod;
  for (int i = 1; i < n; ++i)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (sz - 1));
}
void ntt(int *a, int n) {
  for (int i = 1; i < n - 1; ++i)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int m = 2; m <= n; m <<= 1) {
    for (int i = 0; i < n; i += m) {
      for (int j = 0, k = n, z = n / m; j < (m >> 1); ++j, k -= z) {
        int &u = a[i + j], &v = a[i + j + (m >> 1)];
        int t = (long long)v * w[k] % mod;
        v = u - t < 0 ? u - t + mod : u - t;
        u = u + t >= mod ? u + t - mod : u + t;
      }
    }
  }
  for (int i = 0; i < n; ++i) a[i] = (long long)a[i] * inv_n % mod;
}
int a[N], n, k, d[10], x;
int main(int argc, char const *argv[]) {
  scanf("%d %d", &n, &k);
  while (k--) {
    scanf("%d", &x);
    d[x] = 1;
  }
  int t = 9 * n / 2, sz = 1;
  while (sz < t) sz <<= 1;
  prepare(sz);
  for (int i = 0; i < sz; ++i) {
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[0];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[1];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[2];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[3];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[4];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[5];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[6];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[7];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[8];
    a[i] = (long long)a[i] * w[i] % mod;
    a[i] += d[9];
  }
  x = n >> 1;
  for (int i = 0; i < sz; ++i) a[i] = Pow(a[i], x);
  ntt(a, sz);
  int ans = 0;
  for (int i = 0; i < sz; ++i) {
    ans += (long long)a[i] * a[i] % mod;
    if (ans >= mod) ans -= mod;
  }
  printf("%d\n", ans);
}
