N,A=map(int,input().split())
X=list(map(int,input().split()))
X=[X[i]-A for i in range(0,N)]
dp=[[0 for i in range(0,5000)] for i in range(0,N+1)]#i枚で和がj-2500のもの
dp[0][2500]=1
for i in range(1,N+1):
    for j in range(0,5000):
        if j>=X[i-1] and 4999>=j-X[i-1]:
            dp[i][j]=dp[i-1][j]+dp[i-1][j-X[i-1]]
        else:
            dp[i][j]=dp[i-1][j]
print(dp[N][2500]-1)