from itertools import combinations
N, S = map(int,input().split())
arr = list(map(int,input().split()))
cnt = 0
for i in range(1,len(arr)+1):
answer = list(combinations(arr,i))
for idx in range(len(answer)):
sum_partier = sum(answer[idx])
if sum_partier == S :
cnt += 1
print(cnt)