""" https://yukicoder.me/problems/no/1189 各桁1回づつしか使えない 各桁が重ならないような取り方の数を数える Aも実は1000通りぐらいしかない あとはdp 1000*1000ぐらい """ from sys import stdin import sys def modfac(n, MOD): f = 1 factorials = [1] for m in range(1, n + 1): f *= m f %= MOD factorials.append(f) inv = pow(f, MOD - 2, MOD) invs = [1] * (n + 1) invs[n] = inv for m in range(n, 1, -1): inv *= m inv %= MOD invs[m - 1] = inv return factorials, invs def modnCr(n,r,mod,fac,inv): #上で求めたfacとinvsを引数に入れるべし(上の関数で与えたnが計算できる最大のnになる) return fac[n] * inv[n-r] * inv[r] % mod def cdig(n): ret = 0 for i in range(10): if (2**i) & n > 0: ret += 1 return ret mod = 998244353 N,K = map(int,stdin.readline().split()) A = list(map(int,stdin.readline().split())) nums = [0] * 1024 if K >= 10: print (0) sys.exit() facs,invs = modfac(K+10,mod) for i in A: nums[i] += 1 dp = [ [0]*(K+1) for i in range(1024) ] dp[0][0] = 1 tmps = [ (cdig(i),i) for i in range(1024) ] tmps.sort() for dnum,x in tmps: for i in range(1024): for nk in range(K): if x & i == 0: dp[x | i][nk+1] += dp[x][nk] * nums[i] dp[x | i][nk+1] %= mod ans = 0 for i in range(1024): ans += dp[i][-1] ans %= mod print ((ans * invs[K]) % mod)