N, W = map(int, input().split()) A = [int(a) for a in input().split()] ans = 0 for i in range(1 << N): j = i + 1 while j: j = (j - 1) & i s = 0 for k in range(N): if j >> k & 1: s += A[k] // 2 elif i >> k & 1: s += A[k] if s == W: ans += 1 break print(ans)