N,W = map(int,input().split()) a = list(map(int,input().split())) ans = 0 s = set() def dfs(w,i,n): global s if i>=N or w>=W: if w==W:s.add(n) else: dfs(w+a[i],i+1,n|2**i) dfs(w,i+1,n) dfs(w+a[i]//2,i+1,n|2**i) dfs(0,0,0) print(len(s) if W>0 else pow(2,a.count(0)))