from itertools import product n,w=map(int,input().split()) a=list(map(int,input().split())) ans=set() for bit in product(range(3),repeat=n): if sum(bit)==0: continue tmp=0 for i in range(n): if bit[i]==1: tmp+=a[i] elif bit[i]==2: tmp+=a[i]//2 if tmp==w: sel=[] for i in range(n): if bit[i]!=0: sel.append(i) sel=tuple(sel) ans.add(sel) print(len(ans))