# coding: utf-8
# Your code here!
N,A=map(int,input().split())

card=list(map(int,input().split()))
ans=0
for i in range(2**N):
    all=0
    count=0
    for j in range(N):
        if (i>>j)&1:
            all+=card[j]
            count+=1
    if all==(A*count):
        ans+=1
            
print(ans-1)
#わからんとりとり
