#include using namespace std; typedef long long ll; #define REP(i,n) for(int i=0; i #define VP vector> #define VPP vector>> #define VLL vector #define VVI vector> #define VVLL vector> #define VC vector #define VS vector #define VVC vector> #define VB vector #define VVB vector> #define fore(i,a) for(auto &i:a) typedef pair P; template using min_priority_queue = priority_queue, greater>; template bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } const int INF = (1 << 30) - 1; const ll INFL = 1LL << 60; const ll mod = 998244353; ll dp[2050][2050][11]; int main(){ int n, kk; cin >> n >> kk; VI a(2050, 0); REP(i, n) { int b; cin >> b; a[b]++; } if (kk > 10) { cout << 0 << endl; return 0; } if (kk == 2) { ll ans = 0; REP(i, 2050) { FOR(j, i + 1, 2050) { if ((i + j) == (i^j)) { ans += a[i] * a[j]; ans %= mod; } } } cout << ans << endl; return 0; } dp[0][0][0] = 1; FOR(i, 1, 2050) { REP(j, 2050)REP(k, 11) { dp[i][j][k] += dp[i - 1][j][k]; dp[i][j][k] %= mod; } REP(j, 2050 - i) { if ((i + j) != (i^j))continue; REP(k, 10) { dp[i][i + j][k + 1] += dp[i - 1][j][k] * a[i]; dp[i][i + j][k + 1] %= mod; } } } ll ans = 0; REP(i, 2050) { REP(j, 2050) { ans += dp[i][j][kk]; ans %= mod; } } cout << ans << endl; }