package no137; import java.util.Scanner; public class Main { public static final int MAX = 50000; public static final long MOD = 1234567891; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long m = sc.nextLong(); int[] a = new int[n]; for(int i=0;i 0) { for(int i=0;i=a[i];j--) { dp[j] += dp[j-a[i]]; if (dp[j] >= MOD) { dp[j] -= MOD; } } } for(int i=0;i<=MAX;i++) { int j = (int) (i * 2 + (m & 1)); if (j <= MAX) { dp[i] = dp[j]; }else{ dp[i] = 0; } } m /= 2; } System.out.println(dp[0]); } }