n, k = map(int, input().split()) a = list(map(int, input().split())) g = [0] * 1024 for x in a: g[x] += 1 def gen(x, n, l): if bin(x).count('1') < n: yield list() elif n == 0: yield l else: y = x while y: if g[y] > 0: yield from gen(x ^ y, n - 1, l + [y]) y = (y - 1) & x if l and y < l[-1]: break ans = 0 mod = 998244353 if k > 10: print(0) exit(0) for l in gen(1023, k, list()): if not l: continue # print(l) cur = 1 for x in l: cur = cur * g[x] % mod # if cur: # print(l, cur) ans = (ans + cur) % mod print(ans)