N,A=map(int,input().split())
X=list(map(int,input().split()))
dp=[[0]*5001 for _ in range(N+1)]
dp[0][2500]=1
for i in range(N):
    for j in range(5001):
        if dp[i][j]>0:
            dp[i+1][j]+=dp[i][j]
            dp[i+1][j+X[i]-A]+=dp[i][j]
print(dp[N][2500]-1)
