N,W = map(int,input().split()) A = list(map(int,input().split())) ans = 0 for status in range(1 << N): val = 0 for i in range(N): if (status >> i) & 1: val += A[i] // 2 if val > W: continue for bits in range(1 << N): temp = val for i in range(N): if (status >> i) & 1 == 0 or (bits >> i) & 1 == 0: continue temp += A[i] // 2 if temp == W: ans += 1 break print(ans)