import sys
import copy

readline = sys.stdin.buffer.readline


def main():
    N, A = map(int, readline().split())
    X = list(map(int, readline().split()))
    X = [x - A for x in X]

    dp = [0] * 5050
    dp[2525] = 1

    for i in range(N):

        next_dp = copy.copy(dp)
        for t in range(5050):
            if X[i] + t < 5050:
                next_dp[X[i] + t] += dp[t]

        dp = next_dp

    print(dp[2525] - 1)


if __name__ == '__main__':
    main()
