import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N, A = map(int, input().split())
    X = list(map(int, input().split()))

    # dp[i][k][s] := i個までみて，それまでにk選んでて，そのときの総和がsとなる物の総数
    dp = [[[0] * (N * A + 1) for _ in range(N + 1)] for _ in range(N + 1)]

    dp[0][0][0] = 1
    for i in range(N):
        for k in range(N):
            for s in range(N * A + 1):
                # 使わない
                dp[i + 1][k][s] += dp[i][k][s]

                # 使う
                if s + X[i] <= N * A:
                    dp[i + 1][k + 1][s + X[i]] += dp[i][k][s]

    ans = 0
    for i in range(1, N + 1):
        ans += dp[-1][i][i * A]

    print(ans)


if __name__ == "__main__":
    main()
