N,W = map(int,input().split()) lsA = list(map(int,input().split())) vals = set() for i in range(N): lsA0 = lsA[:] lsA0[i] = lsA0[i]//2 for j in range(2**N): cost = 0 for k in range(N): if (j>>k) & 1: cost += lsA0[k] if cost == W: vals.add(j) for j in range(2**N): cost = 0 for k in range(N): if (j>>k) & 1: cost += lsA[k] if cost == W: vals.add(j) print(len(vals))