n, a = map(int, input().split())
x = list(map(int, input().split()))
max_ = sum(x)

# dp[i枚目のカード][すでに何枚選んでいるか][値]
dp = [[[0] * (max_ + 1) for i in range(n + 1)] for i in range(n + 1)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(n):
        for num in range(max_ + 1):
            # i枚目を選ぶ
            if num - x[i] >= 0:
                dp[i + 1][j + 1][num] += dp[i][j][num - x[i]]
            # i枚目を選ばない
            dp[i + 1][j][num] += dp[i][j][num]

ans = 0
for i in range(1, n + 1):
    for val in range(1, max_ + 1):
        if val == a * i:
            ans += dp[-1][i][val]
print(ans)
