from collections import defaultdict N, K = map(int, input().split()) A = list(map(lambda x: int(x) - K, input().split())) dp = defaultdict(int) dp[0] = 1 for a in A: for key, cnt in dp.copy().items(): dp[key + a] += cnt ans = sum(cnt for key, cnt in dp.items() if key >= 0) print(ans - 1)