def main():
    offset = 2500
    W = 2 * offset + 1
    N, A = list(map(int, input().split(' ')))
    x = list(map(int, input().split(' ')))
    y = [xx - A for xx in x]
    dp = [[0 for _ in range(W)] for _ in range(N)]
    dp[0][0 + offset] += 1
    dp[0][y[0] + offset] += 1
    for i in range(1, N):
        for j in range(W):
            dp[i][j] = dp[i - 1][j]
            if 0 <= j - y[i] <= W - 1:
                dp[i][j] += dp[i - 1][j - y[i]]
    print(dp[N - 1][0 + offset] - 1)  # remove the no card case


if __name__ == '__main__':
    main()
