N, W = map(int, input().split()) a = list(map(int, input().split())) ans = 0 for i in range(1, 1 << N): C = [] res = 0 add = 0 for j in range(N): if i & 1 << j: res += a[j] C.append(j) if res == W: add = 1 L = len(C) for j in range(1 << L): res2 = res for k in range(L): if j & 1 << k: res2 -= a[C[k]] // 2 if res2 == W: add = 1 ans += add print(ans)