#include <bits/stdc++.h>
/*
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
*/
using namespace std;
const double eps = 1e-10;
const double pi = 3.1415926535897932384626433832795;
const double eln = 2.718281828459045235360287471352;
#define f(i, a, b) for (int i = a; i <= b; i++)
#define scan(x) scanf("%d", &x)
#define mp make_pair
#define pb push_back
#define lowbit(x) (x&(-x))
#define fi first
#define se second
#define SZ(x) int((x).size())
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define summ(a) (accumulate(all(a), 0ll))
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
using ll=long long;
const int mod=998244353,g=3,gi=332748118,NR=1<<21;
int A[NR],rev[NR],bit,lim,n,k,len,res;
int powmod(int a,int b){
int res=1;
for(;b>0;b>>=1,a=1ll*a*a%mod)if(b&1)res=1ll*res*a%mod;
return res;
}
void NTT(int *a,int type){
for(int i=0;i<lim;++i)if(i<rev[i])swap(a[i],a[rev[i]]);
for(int k=1;k<lim;k<<=1){
int wn=powmod(type==1?g:gi,(mod-1)/(k<<1));
for(int i=0;i<lim;i+=(k<<1)){
int w=1;
for(int j=0;j<k;++j,w=1ll*w*wn%mod){
int x=a[i+j],y=1ll*w*a[i+j+k]%mod;
a[i+j]=(x+y)%mod,a[i+j+k]=(x-y+mod)%mod;
}
}
}
if(type==1)return ;
int invn=powmod(lim,mod-2);
for(int i=0;i<lim;++i){
a[i]=1ll*a[i]*invn%mod;
}
}
void poly_fast(int *a,int b){
lim=1,bit=0;
while(lim<=len*2)lim<<=1,bit+=1;
for(int i=0;i<lim;++i)rev[i]=(rev[i>>1]>>1)|((i&1)<<(bit-1));
NTT(a,1);
for(int i=0;i<lim;++i)a[i]=powmod(a[i],b);
NTT(a,0);
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n>>k;
len=9*n/2;
for(int i=1,x;i<=k;++i){
cin>>x;
A[x]=1;
}
poly_fast(A,n/2);
for(int i=0;i<=lim;++i){
res=(res+1ll*A[i]*A[i]%mod)%mod;
}
cout<<res;
return 0;
}