N,A = map(int, input().split())
xs = list(map(int, input().split()))
"""
dp[i][j][n] : i枚目において、j枚選んだときの合計がnになる場合の数
dp[i+1][j+1][n+x] = dp[i][j][n] * (x) + dp[i][j+1][n+x]
dp[0][0][0] = 1
"""
Nx = 2550
dp = [[[0]*Nx for i in range(N+10)] for j in range(N+10)]
dp[0][0][0] = 1

for i in range(N):
    x = xs[i]
    for j in range(N):
        for n in range(Nx):
            dp[i+1][j][n] = dp[i][j][n]
    for j in range(N):
        for n in range(Nx):
            if n + x >= Nx:continue
            dp[i+1][j+1][n+x] = dp[i][j][n] + dp[i][j+1][n+x]
    # print(i,dp[i])
cnts = dp[N]
ans = 0
for i in range(1,N+1):
    ans += cnts[i][A*i]
print(ans)