N, W = map(int, input().split()) A = list(map(int, input().split())) ans = 0 for i in range(1, 1 << N): flag = 0 cnt = 0 for j in range(N): if (i >> j) & 1: cnt += A[j] if cnt == W: flag = 1 sub = i while sub: temp = W for j in range(N): if (sub >> j) & 1: temp += A[j]//2 if cnt == temp: flag = 1 sub = i & (sub - 1) ans += flag print(ans)