import itertools
import sys
input = sys.stdin.readline
n,a=(int(i) for i in input().split())
x=[int(i) for i in input().split()]
#print(n,a,x)

mylist=list(itertools.product(range(2), repeat=n))

cnt=0
for j in range(2**n):
    val=0
    for i in range(n):
        val+=mylist[j][i]*x[i]
    if val==a*sum(mylist[j]):
#        print(mylist[j])
        cnt+=1
print(cnt-1)