mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N, W = map(int, input().split()) A = list(map(int, input().split())) ans = set() for i in range(3 ** N): X = 0 ii = 0 for j in range(N): if i % 3 == 1: X += A[j] ii += (1 << j) elif i % 3 == 2: X += A[j] // 2 ii += (1 << j) i //= 3 if X == W: ans.add(ii) print(len(ans)) if __name__ == '__main__': main()