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