#pragma GCC optimize ("O3") #pragma GCC target ("avx") #include using namespace std; #define rep(i,n) for(int i=0;i P; #define fi first #define sc second #define mp make_pair typedef unsigned int ui; const ui mod = 1234567891; ui dp[64][25005], tmp[50005], n, a[55]; long long m; inline void add(ui &a, ui b) { a += b; if(a >= mod) a -= mod; } int main(){ ios::sync_with_stdio(0); cin >> n >> m; rep(i, n) { cin >> a[i]; } dp[0][0] = 1; rep(i, 60){ memset(tmp, 0, sizeof(tmp)); memcpy(tmp, *(dp+i), sizeof(*(dp+i))); rep(j, n){ for(int k=50003-(int)a[j];k>=0;k--) add(tmp[k+a[j]], tmp[k]); } int f = ((m>>i)&1); rep(j, 50005){ if(f != (j&1)) continue; add(dp[i+1][j/2], tmp[j]); } } cout << dp[60][0] << '\n'; }