n, s = map(int, input().split())
arr=[0]*(n+1)
arr = list(map(int, input().split()))
 
cnt = 0
 
def part_sum(i, sum):
    global cnt
 
    if i >= n:
        return
    sum = sum+ arr[i]
 
    if sum == s:
        cnt = cnt + 1
    part_sum(i + 1, sum)
 
    sum = sum - arr[i]
    part_sum(i + 1, sum)
    
    
part_sum(0, 0)
print(cnt)

+ Recent posts