#include using namespace std; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(),(v).end() templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> n >> k; vector a(n); REP(i,n){ cin >> a[i]; } vector> dp(k+2,vector(1024)); dp[0][0]=1; REP(i,n){ vector> tp(k+2,vector(1024)); REP(j,k+1){ REP(l,1024){ if(!dp[j][l]) continue; (tp[j][l]+=dp[j][l])%=mod; if(!(l&a[i])){ (tp[j+1][l+a[i]]+=dp[j][l])%=mod; } } } swap(dp,tp); } ll ans=0; REP(i,1024){ (ans+=dp[k][i])%=mod; } cout << ans << endl; }