#include //#include "atcoder/all" typedef long long int ll; using namespace std; // using namespace atcoder; #define MAXN 1024 #define mod 998244353 ll Pow(ll a, ll n) { if (n == 0) return 1; if (n % 2) return (a * Pow(a, n - 1)) % mod; else { ll k = Pow(a, n / 2); return (k * k) % mod; } } ll gyakusuu[MAXN + 1]; ll cnt[MAXN]; ll dp[MAXN][11]; int main() { for (int i = 1; i <= MAXN; i++) { gyakusuu[i] = Pow(i, mod - 2); } ll n, K; cin >> n >> K; if (K >= 11) { cout << 0 << endl; return 0; } for (int i = 0; i < n; i++) { ll a; cin >> a; cnt[a]++; } memset(dp, 0, sizeof(dp)); dp[0][0] = 1; for (int i = 0; i < 1024; i++) { for (int j = 0; j < 1024; j++) { // p xor i = j とななるような p ll count = 1; ll p = 0; bool ok = true; ll i1 = i; ll j1 = j; for (int k = 1; k <= 10; k++) { if ((j1 % 2 == 0)&&(i1 % 2 == 1)) { ok = false; } else if ((j1 % 2 == 1)&&(i1 % 2 == 0)) { p += count; } count *= 2; i1 /= 2; j1 /= 2; } if (ok) { for (int k = 1; k <= 10; k++) { dp[j][k] = (dp[j][k] + dp[i][k - 1] * cnt[p]) % mod; } } } } ll ret = 0; for (int i = 1; i <= 1023; i++) { ret = (ret + dp[i][K]) % mod; } for (int i = 1; i <= K; i++) { ret = ret * gyakusuu[i] % mod; } cout << ret << endl; return 0; }