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): for j in product([0,1],repeat=i.count(1)): 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)