n,w = map(int,input().split()) a = list(map(int,input().split())) ans = 0 for i in range(1 << n): # l = [0] l = [] for j in range(n): if i & (1 << j): l.append(a[j]) nn = len(l) # for x in range(nn): # res = 0 # for y in range(nn): # if y == x: # res += l[y] // 2 # else: # res += l[y] # if res == w: # ans += 1 for x in range(1 << nn): res = 0 for y in range(nn): if x & (1 << y): res += l[y] else: res += l[y] // 2 if res == w: ans += 1 break print(ans)