#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
const int MOD = 998244353;
inline int add(int u, int v) { return (u + v) % MOD; }
inline int sub(int u, int v) { return (u - v + MOD) % MOD; }
inline int mul(int u, int v) { return (long long)u * v % MOD; }
inline int power(int u, int v) {
  int res = 1;
  while (v) {
    if (v & 1) res = mul(res, u);
    u = mul(u, u);
    v >>= 1;
  }
  return res;
}
inline int inv(int u) { return power(u, MOD - 2); }
int n, k;
int sz;
struct NTT {
  int base = 1;
  int maxBase = 0;
  int root = 2;
  vector<int> w = {0, 1};
  vector<int> rev = {0, 1};
  NTT() {
    int u = MOD - 1;
    while (u % 2 == 0) {
      u >>= 1;
      maxBase++;
    }
    while (1) {
      if (power(root, 1 << maxBase) == 1 &&
          power(root, 1 << (maxBase - 1)) != 1) {
        break;
      }
      root++;
    }
  }
  void ensure(int curBase) {
    assert(curBase <= maxBase);
    if (curBase <= base) return;
    rev.resize(1 << curBase);
    for (int i = 0; i < (1 << curBase); i++) {
      rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (curBase - 1));
    }
    w.resize(1 << curBase);
    for (; base < curBase; base++) {
      int wc = power(root, 1 << (maxBase - base - 1));
      for (int i = 1 << (base - 1); i < (1 << base); i++) {
        w[i << 1] = w[i];
        w[i << 1 | 1] = mul(w[i], wc);
      }
    }
  }
  void fft(vector<int> &a) {
    int n = a.size();
    int curBase = 0;
    while ((1 << curBase) < n) curBase++;
    int shift = base - curBase;
    for (int i = 0; i < n; i++) {
      if (i < (rev[i] >> shift)) swap(a[i], a[rev[i] >> shift]);
    }
    for (int k = 1; k < n; k <<= 1) {
      for (int i = 0; i < k; i++) {
        for (int j = i; j < n; j += k * 2) {
          int foo = a[j];
          int bar = mul(a[j + k], w[i + k]);
          a[j] = add(foo, bar);
          a[j + k] = sub(foo, bar);
        }
      }
    }
  }
  vector<int> mult(vector<int> a, vector<int> b) {
    int nResult = a.size() + b.size() - 1;
    int curBase = 0;
    while ((1 << curBase) < nResult) curBase++;
    ensure(curBase);
    a.resize(1 << curBase), b.resize(1 << curBase);
    fft(a);
    fft(b);
    for (int i = 0; i < (1 << curBase); i++) {
      a[i] = mul(mul(a[i], b[i]), inv(1 << curBase));
    }
    reverse(a.begin() + 1, a.end());
    fft(a);
    a.resize(nResult);
    return a;
  }
  vector<int> sqr(vector<int> a) {
    int nResult = a.size() + a.size() - 1;
    int curBase = 0;
    while ((1 << curBase) < nResult) curBase++;
    ensure(curBase);
    a.resize(1 << curBase);
    fft(a);
    for (int i = 0; i < (1 << curBase); i++) {
      a[i] = mul(mul(a[i], a[i]), inv(1 << curBase));
    }
    reverse(a.begin() + 1, a.end());
    fft(a);
    a.resize(nResult);
    while (!a.empty() && !a.back()) a.pop_back();
    return a;
  }
} ntt;
vector<int> go(vector<int> &u, int v) {
  if (v == 0) return vector<int>(1, 1);
  if (v % 2 == 0) {
    vector<int> foo = go(u, v >> 1);
    return ntt.sqr(foo);
  }
  vector<int> res = go(u, v - 1);
  vector<int> now(res.size() + u.size() - 1, 0);
  for (int i = 0; i < res.size(); i++) {
    for (int j = 0; j < u.size(); j++) {
      now[i + j] = add(now[i + j], mul(res[i], u[j]));
    }
  }
  return now;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  sz = 9 * n / 2 + 1;
  vector<int> a(10, 0);
  for (int i = 1; i <= k; i++) {
    int u;
    cin >> u;
    a[u] = 1;
  }
  vector<int> res = go(a, n / 2);
  int ans = 0;
  for (int i = 0; i < res.size(); i++) {
    ans = add(ans, mul(res[i], res[i]));
  }
  cout << ans << endl;
  return 0;
}
