""" """ from sys import stdin import sys N,W = map(int,stdin.readline().split()) a = list(map(int,stdin.readline().split())) ans = set() for i in range(3**N): now = 0 s = [] for j in range(N): if i % 3 == 0: now += a[j] elif i % 3 == 1: now += a[j] // 2 else: s.append(j) i //= 3 s.sort() if now == W: ans.add(tuple(s)) print (len(ans))