n,k = map(int,input().split()) a = list(map(int,input().split())) mod = 998244353 if(k > 10): print(0) exit() from collections import Counter cnt=Counter(a) dp=[[0] * (2**10) for _ in range(k+1)] dp[0][0]=1 for x in range(2**10): for i in range(k): for y in range(2**10): if(x&y)==0: dp[i+1][x|y] += dp[i][y] * cnt[x] dp[i+1][x|y] %= mod ans = sum(dp[-1])%mod print(ans)