#include using namespace std; #define pb push_back #define eb emplace_back //mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); #define mod 998244353 #define ll long long #define inf 0x3f3f3f3f #define INF 0x3f3f3f3f3f3f3f3f inline int read() { char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();} int ans=0; while(isdigit(ch)) {ans=ans*10+ch-48;ch=getchar();} if(nega==-1) return -ans; return ans; } void print(vector x){for(int i=0;i<(int)x.size();i++) printf("%d%c",x[i]," \n"[i==(int)x.size()-1]);} inline int add(int x,int y) {return x+y>=mod?x+y-mod:x+y;} inline int add(int x,int y,int z) {return add(add(x,y),z);} inline int sub(int x,int y) {return x-y<0?x-y+mod:x-y;} inline int mul(int x,int y) {return 1LL*x*y%mod;} inline int mul(int x,int y,int z) {return mul(mul(x,y),z);} #define inc(x,y) x=add(x,y) #define dec(x,y) x=sub(x,y) #define MN 100005 int f[MN],g[MN],N,M,m=100; int fac[MN],inv[MN],ifac[MN]; void init() { fac[0]=1; for(int i=1;i>N>>M; f[0]=0; for(int i=1;i<=M;i++) f[i]=read(); sort(f+1,f+M+1); g[0]=1; for(int n=0;n<=N;n++) { int res=0; for(int i=1;i<=M&&f[i]-1<=n;i++) inc(res,mul(f[i],g[n+1-f[i]])); res=mul(res,N+1); for(int i=1;i<=M&&f[i]<=n;i++) dec(res,mul(n-f[i]+1,g[n-f[i]+1])); g[n+1]=mul(res,inv[n+1]); } // cout<