import sys sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N,K = MI() A = LI() mod = 998244353 if K >= 11: print(0) exit() count = [0]*1024 for a in A: count[a] += 1 dp = [[0]*1024 for _ in range(K+1)] # dp[i][j] = 和集合がjに含まれるような、i個の数字の選び方 for j in range(1024): k = j while k: dp[0][j] += count[k] k = (k-1) & j dp[0][j] += 1 for i in range(1,K+1): for j in range(1,1024): k = j while k: dp[i][j] += dp[i-1][j^k]*count[k] dp[i][j] %= mod k = (k-1) & j x = 1 for i in range(2,K+1): x *= i ans = dp[-1][-1]*pow(x,mod-2,mod) print(ans % mod)