N,W = map(int,input().split()) A = list(map(int,input().split())) ans = set() for status in range(3 ** N): i = 0 val = 0 cond = 0 while status: if status % 3 == 2: val += A[i] cond |= (1 << i) elif status % 3 == 1: val += A[i] // 2 cond |= (1 << i) status //= 3 i += 1 if val == W: ans.add(cond) print(len(ans))