import collections MOD=998244353 N,K=map(int,input().split()) A=collections.Counter(list(map(int,input().split()))) if K>10: exit(print(0)) dp=[[0]*11 for _ in range(1<<10)] dp[0][0]=1 for a in A: s=(~a)&((1<<10)-1) while True: for i in range(10): dp[a|s][i+1]=(dp[a|s][i+1]+dp[s][i]*A[a])%MOD if s==0: break s=(s-1)&(~a) ans=0 for i in range(1,1<<10): ans=(ans+dp[i][K])%MOD print(ans)