import static java.lang.Math.*; import static java.math.BigInteger.*; import static java.util.Arrays.*; import static java.util.Collections.*; import java.math.*; import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { new Main().run(); } Scanner in = new Scanner(System.in); void _out(Object...os) { System.out.println(deepToString(os)); } void _err(Object...os) { System.err.println(deepToString(os)); } void run() { long MO = 1234567891; for (; in.hasNext(); ) { int n = in.nextInt(); long m = in.nextLong(); int[] as = new int[n]; for (int i = 0; i < n; ++i) { as[i] = in.nextInt(); } int sum = 0; for (int i = 0; i < n; ++i) { sum += as[i]; } long[] dp = new long[sum * 2]; dp[0] = 1; for (long mm = m; mm != 0; mm >>= 1) { for (int i = 0; i < n; ++i) { for (int x = sum * 2; --x >= as[i]; ) { dp[x] += dp[x - as[i]]; dp[x] %= MO; } } for (int x = 0; x < sum; ++x) { dp[x] = dp[x << 1 | (int)(mm & 1)]; } for (int x = sum; x < sum * 2; ++x) { dp[x] = 0; } } System.out.println(dp[0]); } } }