n, w = map(int, input().split()) a = list(map(int, input().split())) ans = 0 for b in range(1, 1 << n): cnt = 0 l = [] for i in range(n): if b >> i & 1: cnt += a[i] l.append(a[i]) f = False if cnt == w: f = True for b2 in range(1 << len(l)): cnt2 = cnt for i in range(len(l)): if b2 >> i & 1: cnt2 -= l[i] // 2 if cnt2 == w: f = True; break ans += f print(ans)