from itertools import product n,w=map(int,input().split()) a=list(map(int,input().split())) ans=0 for i in product([0,1],repeat=n): t=i.count(1) if t == 0: continue for j in product([0,1],repeat=t): indj=0 cntw=0 for k in range(n): if i[k] == 1: if j[indj] == 1: cntw += a[k]//2 else: cntw += a[k] indj+=1 if cntw == w: ans+=1 break print(ans)