#include #define rep(i,n) for(int i = 0; i < (n); ++i) #define srep(i,s,t) for(int i = s; i < t; ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) using namespace std; typedef long long int ll; typedef pair P; #define yn {puts("Yes");}else{puts("No");} #define MAX_N 200005 ll dp[1024][1024][11]; int main() { ll cnt[1024] = {}; int n, K; cin >> n >> K; rep(i,n){ int a; cin >> a; cnt[a]++; } ll MOD = 998244353; rep(i,1024)rep(j,1024)rep(k,11)dp[i][j][k] = 0; dp[0][0][0] = 1; srep(i,1,1024){ rep(j,1024)rep(k,11)dp[i][j][k] = dp[i-1][j][k]; rep(j,1024){ int x = i + j; int y = (i ^ j); if(x != y) continue; srep(k,1,11){ dp[i][y][k] += dp[i-1][j][k-1] * cnt[i]; dp[i][y][k] %= MOD; } } } ll ans = 0; rep(j,1024){ ans += dp[1023][j][K]; ans %= MOD; } cout << ans << endl; return 0; }