import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) INF = float("INF") MOD = 10 ** 9 + 7 MOD2 = 998244353 from heapq import heappop, heappush import math from collections import Counter, deque from itertools import accumulate, combinations, combinations_with_replacement, permutations from bisect import bisect_left, bisect_right import decimal def inv(a, p): x = a f = p - 2 ret = 1 while f > 1: if f % 2 == 0: x = x * x % p f //= 2 else: ret *= x ret %= p f -= 1 ret *= x ret %= p return ret n, k = map(int, input().split()) a = list(map(int, input().split())) d = dict() for i in a: if i not in d: d[i] = 0 d[i] += 1 if k > 10: print(0) else: dp = [[0] * 1024 for _ in range(k + 1)] dp[0][0] = 1 for i in range(k): for j in range(1024): for l in d: if j & l == 0: dp[i + 1][j | l] += dp[i][j] * d[l] % MOD2 ans = 0 for i in range(1024): ans += dp[-1][i] ans %= MOD2 for i in range(1, k + 1): ans *= inv(i, MOD2) ans %= MOD2 print(ans)