#include "bits/stdc++.h" using namespace std; #define int long long #define rep(i,n) for(int i=0;i #define all(a) a.begin(),a.end() typedef pair P; const long long mod=998244353; const long long inf=1ll<<61; const int maxN=100; int cnt[1111]; int cmb[1111]; int dp[12][1024];int kj[600006],kji[600006]; int modpow(int a,int x){ int res=1; while(x){ if(x&1)res=res*a%mod; a=a*a%mod; x>>=1; } return res; } void setkj(){ kj[0]=kji[0]=1; for(int i=1;i<=600002;i++){ kj[i]=kj[i-1]*i%mod; kji[i]=modpow(kj[i],mod-2); } } int comb(int r,int c){ if(r>n>>k; rep(i,n){ int a;cin>>a;cnt[a]++; } dp[0][0]=1; // rep(i,1024){ rep(j,11){ rep(l,1<<10){ if(!dp[j][l])continue; int m=1023-l; for(int t=m;;t=(t-1)&m){ if(t==0)break; dp[j+1][t+l]+=dp[j][l]*cnt[t]%mod; dp[j+1][t+l]%=mod; } } } // } int sum=0; rep(i,1<<10){ rep(j,min(k+1,11ll)){ sum+=dp[j][i]*comb(cnt[0],k-j)%mod; sum%=mod; } } sum*=kji[k]; cout<