#include /** * @title Modint * @docs mint.md */ template class ModInt{ public: constexpr static int32_t MOD = M; uint32_t val; constexpr ModInt(): val(0){} constexpr ModInt(int64_t n){ if(n >= M) val = n % M; else if(n < 0) val = n % M + M; else val = n; } constexpr auto& operator=(const ModInt &a){val = a.val; return *this;} constexpr auto& operator+=(const ModInt &a){ if(val + a.val >= M) val = (uint64_t)val + a.val - M; else val += a.val; return *this; } constexpr auto& operator-=(const ModInt &a){ if(val < a.val) val += M; val -= a.val; return *this; } constexpr auto& operator*=(const ModInt &a){ val = (uint64_t)val * a.val % M; return *this; } constexpr auto& operator/=(const ModInt &a){ val = (uint64_t)val * a.inv().val % M; return *this; } constexpr auto operator+(const ModInt &a) const {return ModInt(*this) += a;} constexpr auto operator-(const ModInt &a) const {return ModInt(*this) -= a;} constexpr auto operator*(const ModInt &a) const {return ModInt(*this) *= a;} constexpr auto operator/(const ModInt &a) const {return ModInt(*this) /= a;} constexpr bool operator==(const ModInt &a) const {return val == a.val;} constexpr bool operator!=(const ModInt &a) const {return val != a.val;} constexpr auto& operator++(){*this += 1; return *this;} constexpr auto& operator--(){*this -= 1; return *this;} constexpr auto operator++(int){auto t = *this; *this += 1; return t;} constexpr auto operator--(int){auto t = *this; *this -= 1; return t;} constexpr static ModInt power(int64_t n, int64_t p){ if(p < 0) return power(n, -p).inv(); int64_t ret = 1, e = n % M; for(; p; (e *= e) %= M, p >>= 1) if(p & 1) (ret *= e) %= M; return ret; } constexpr static ModInt inv(int64_t a){ int64_t b = M, u = 1, v = 0; while(b){ int64_t t = a / b; a -= t * b; std::swap(a,b); u -= t * v; std::swap(u,v); } u %= M; if(u < 0) u += M; return u; } constexpr static auto frac(int64_t a, int64_t b){return ModInt(a) / ModInt(b);} constexpr auto power(int64_t p) const {return power(val, p);} constexpr auto inv() const {return inv(val);} friend constexpr auto operator-(const ModInt &a){return ModInt(M-a.val);} friend constexpr auto operator+(int64_t a, const ModInt &b){return ModInt(a) + b;} friend constexpr auto operator-(int64_t a, const ModInt &b){return ModInt(a) - b;} friend constexpr auto operator*(int64_t a, const ModInt &b){return ModInt(a) * b;} friend constexpr auto operator/(int64_t a, const ModInt &b){return ModInt(a) / b;} friend std::istream& operator>>(std::istream &s, ModInt &a){s >> a.val; return s;} friend std::ostream& operator<<(std::ostream &s, const ModInt &a){s << a.val; return s;} template static auto div(){ static auto value = inv(N); return value; } explicit operator int32_t() const noexcept {return val;} explicit operator int64_t() const noexcept {return val;} }; namespace solver{ using mint = ModInt<998244353>; constexpr int MAX = 1 << 10; static int count[MAX]; static mint dp[11][MAX]; void solve(){ std::cin.tie(0); std::ios::sync_with_stdio(false); int N, K; std::cin >> N >> K; std::vector A(N); for(int i = 0; i < N; ++i) std::cin >> A[i]; mint ans = 0; if(K <= 10){ for(int i = 0; i < N; ++i) count[A[i]] += 1; dp[0][0] = 1; for(int i = 0; i < K; ++i){ for(int j = 0; j < MAX; ++j){ for(int k = 0; k < MAX; ++k){ if(j + k == (j ^ k)) dp[i + 1][j + k] += dp[i][j] * count[k]; } } } for(int i = 0; i < MAX; ++i) ans += dp[K][i]; for(int i = 1; i <= K; ++i) ans /= i; } std::cout << ans << "\n"; } } int main(){ solver::solve(); return 0; }