mod = 998244353 eps = 10**-9 def main(): import sys input = sys.stdin.readline N, K = map(int, input().split()) A = list(map(int, input().split())) if K > 10: print(0) exit() cnt = [0] * 1024 for a in A: cnt[a] += 1 dp = [[0] * 1024 for _ in range(K+1)] dp[0][0] = 1 for new in range(1, 1024): for k in range(K): for state in range(1024): if state & new == 0: dp[k+1][state | new] = (dp[k+1][state | new] + dp[k][state] * cnt[new])%mod ans = 0 for x in dp[K]: ans = (ans + x)%mod print(ans) if __name__ == '__main__': main()