N, K = map(int, input().split()) A = list(map(int, input().split())) mod = 998244353 M = 1 << 10 D = [0] * M for a in A: D[a] += 1 dp = [0] * M dp[0] = 1 for s1 in range(M): for s2 in range(s1 + 1, M): if s1 + s2 == s1 ^ s2: dp[s1 | s2] += dp[s1] * D[s2] dp[s1 | s2] %= mod print( (sum(dp) - 1 - sum(D)) % mod )