import std.algorithm, std.conv, std.range, std.stdio, std.string; const mod = 1234567891; void main() { auto rd = readln.split, n = rd[0].to!size_t, m = rd[1].to!long; auto a = readln.split.to!(uint[]), sa = a.sum; auto dp1 = new uint[](sa*2+2), dp2 = new uint[](sa*2+2); dp1[0] = 1; for (; m > 0; m /= 2) { foreach (i; 0..n) { dp2[] = dp1[]; dp1[a[i]..$] += dp2[0..$-a[i]]; dp1[a[i]..$] %= mod; } foreach (j; 0..sa+1) dp1[j] = dp1[j*2+m%2]; dp1[sa+1..$] = 0; } writeln(dp1[0]); }