#include #include #include #include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) #define repeat_reverse(i,n) for (int i = (n)-1; (i) >= 0; --(i)) #define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x) typedef long long ll; using namespace std; const int mod = 1234567891; int main() { int n; ll m; cin >> n >> m; vector a(n); repeat (i,n) cin >> a[i]; vector dp { 1, 1 }; m *= 2; while (true) { for (int i = m % 2; i < dp.size(); i += 2) { dp[i/2] = dp[i]; } m /= 2; if (m == 0) break; dp.resize(dp.size() / 2); dp.resize(dp.size() + whole(accumulate, a, 0) + 1); repeat (i,n) { repeat_reverse (j, dp.size() - a[i]) { dp[j + a[i]] += dp[j]; dp[j + a[i]] %= mod; } } } cout << dp[0] << endl; return 0; }