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