N,W = map(int,input().split()) A = list(map(int,input().split())) ans = set() for i in range(1<>k)&1: cnt += B[k] ind.append(k) if cnt==W: ans.add(i) elif cnt>W: for j in range(1<>k)&1: cnt += B[ind[k]]//2 else: cnt += B[ind[k]] if cnt==W: ans.add(i) break print(len(ans))