n, w = map(int, input().split()) A = list(map(int, input().split())) ans_set = set() for bit1 in range(1 << n): half_set = set() for i in range(n): if (bit1 >> i) & 1: half_set.add(i) for bit2 in range(1 << n): if bit1 & bit2: continue not_half_set = set() for i in range(n): if (bit2 >> i) & 1: not_half_set.add(i) tmp = 0 for i in half_set: tmp += A[i] // 2 for i in not_half_set: tmp += A[i] if tmp == w: ans_set.add(bit1 | bit2) print(len(ans_set))