import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int w = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } sc.close(); int ans = 0; int end = 1 << n; for (int i = 1; i < end; i++) { List list = new ArrayList<>(); for (int j = 0; j < n; j++) { if ((i >> j & 1) == 1) { list.add(a[j]); } } int size = list.size(); int end2 = 1 << size; for (int j = 0; j < end2; j++) { long sum = 0; for (int j2 = 0; j2 < size; j2++) { if ((j >> j2 & 1) == 1) { sum += list.get(j2) / 2; } else { sum += list.get(j2); } } if (sum == w) { ans++; break; } } } System.out.println(ans); } }