#define ll long long #define INF 2147483647 #define mod 998244353
int pi = acos(-1); constint G = 3;
inlineintinp(){ char c = getchar(); while(c < '0' || c > '9') c = getchar(); int sum = 0; while(c >= '0' && c <= '9'){ sum = sum * 10 + c - '0'; c = getchar(); } return sum; }
ll powmod(ll a, int b){ ll sum = 1; while(b){ if(b & 1){ sum *= a; sum %= mod; } a *= a; a %= mod; b >>= 1; } return sum; }
int g[8000010], num[8000010]; int len, r[8000010]; int a[8000010], b[8000010], c[8000010]; int wn[8000010]; int invlim; #define add(a, b) ((a) + (b) >= mod ? (a) + (b) - mod : (a) + (b)) #define mine(a, b) ((a) < (b) ? (a) - (b) + mod : (a) - (b)) #define mul(a, b) ((ll)(a) * (ll)(b) % mod)
inlinevoidntt(int *a, int f){ for(int i = 0; i < len; i++) if(i < r[i]) std::swap(a[i], a[r[i]]); for(int i = 1; i < len; i <<= 1){ wn[0] = 1; wn[1] = powmod(G, (mod - 1) / (i << 1)); for(int j = 2; j < i; j++) wn[j] = mul(wn[j - 1], wn[1]); for(int j = 0; j < len; j += i << 1){ int *L = a + j; int *R = L + i; for(int k = 0; k < i; k++){ constint t = mul(wn[k], R[k]); R[k] = mine(L[k], t); L[k] = add(L[k], t); } } } if(f == -1){ std::reverse(a + 1, a + len); for(int i = 0; i < len; i++) a[i] = mul(a[i], invlim); } }
voidinit(int n){ len = 1; int lg = 0; while(len <= n) len <<= 1, lg++; for(int i = 0; i < len; i++) r[i] = (r[i >> 1] >> 1) | ((i & 1) << (lg - 1)); invlim = powmod(len, mod - 2); }
intmain(){ int n = inp() >> 1; int k = inp(); memset(g, 0, sizeof(g)); for(int i = 1; i <= k; i++){ int x = inp(); g[x] = 1; } int pownum = n - 1; memcpy(num, g, sizeof(g)); init(20); while(pownum){ // printf("%d\n", pownum); if(pownum & 1){ int maxw = 0; for(int i = 1; i <= 5000000; i++) if(g[i] > 0) maxw = i; init(maxw << 2); ntt(g, 1); ntt(num, 1); for(int i = 0; i <= len; i++) num[i] = mul(num[i], g[i]); ntt(g, -1); ntt(num, -1); } int maxw = 0; for(int i = 1; i <= 5000000; i++) if(g[i] > 0) maxw = i; init(maxw << 2); ntt(g, 1); for(int i = 0; i <= len; i++) g[i] = mul(g[i], g[i]); ntt(g, -1); pownum >>= 1; } int ans = 0; for(int i = 0; i <= len; i++) ans = add(ans, mul(num[i], num[i])); printf("%d\n", ans); }