import sys
from itertools import combinations as comb
input = sys.stdin.readline
N, S = map(int, input().split())
A = list(map(int, input().split()))
count = 0
for i in range(2, len(A) + 1):
    for c in comb(A, i):
        if sum(c) == 0:
            count += 1
print(count)

dfe925def6303b8f83d8519643c49345de6a6964
<mask token>

<mask token>
for i in range(2, len(A) + 1):
    for c in comb(A, i):
        if sum(c) == 0:
            count += 1
print(count)

<mask token>
input = sys.stdin.readline
N, S = map(int, input().split())
A = list(map(int, input().split()))
count = 0
for i in range(2, len(A) + 1):
    for c in comb(A, i):
        if sum(c) == 0:
            count += 1
print(count)

import sys
from itertools import combinations as comb
input = sys.stdin.readline
N, S = map(int, input().split())
A = list(map(int, input().split()))
count = 0
for i in range(2, len(A) + 1):
    for c in comb(A, i):
        if sum(c) == 0:
            count += 1
print(count)
