#ARC60 C
N,A=map(int,input().split())
X=[""]+list(map(int,input().split()))
for i in range(1,N+1):
    X[i]-=A

dp=[[0 for j in range(5001)] for i in range(N+1)]

dp[0][2500]=1

for i in range(1,N+1):
    for j in range(5001):
        dp[i][j]+=dp[i-1][j]
        if 0<=j+X[i]<=5000:
            dp[i][j+X[i]]+=dp[i-1][j]

print(dp[N][2500]-1)