from itertools import combinations N,W = map(int,input().split()) A = list(map(int,input().split())) ans = 0 for i in range(1,N + 1): for J in combinations(range(N),i): sumj = 0 for k in J: sumj += A[k] if sumj == W: ans += 1 continue for k in range(1, i + 1): f = False for J2 in combinations(J, k): sumj2 = 0 for k2 in J2: sumj2 += A[k2] if sumj - sumj2//2 == W: ans += 1 f = True break if f: break print(ans)