N, W = map(int, input().split()) A = list(map(int, input().split())) ans = set() for S in range(3 ** N): tot = 0 buy = 0 for i, a in enumerate(A): if S % 3 == 0: tot += a buy |= (1 << i) elif S % 3 == 1: tot += a // 2 buy |= (1 << i) S //= 3 if W == tot and buy != 0: ans.add(buy) print(len(ans))